[nSLUG] hostname, /etc/hosts, DHCP

Rich budman85 at eastlink.ca
Sat Feb 24 18:00:05 AST 2007


On Fri, 2007-02-23 at 21:36 -0400, Oliver Doepner wrote:
> Hi,
> 
> I want to understand how local hostname, /etc/hosts and DHCP/DNS on a 
> wireless router all fit together.
> 
> I run Kubuntu on a Laptop. Internet access is through Eastlink using a 
> Wireless router with DD-WRT installed on it. The router's local address 
> is 192.168.1.1.
> 
> I sometimes connect my laptop using the wireless interface (wlan0), 
> sometimes over ethernet (eth0). I have setup static DHCP leases on the 
> router so that wlan0 is always 192.168.1.30 with hostname 
> "satellite-wlan0" in the routers DNS and eth0 always gets 192.168.1.20 
> and hostname "satellite-eth0".
> 
> The (local) hostname of the laptop is "satellite", /etc/hosts consists 
> of one line (except for ipv6 stuff):
> 
> 127.0.0.1 localhost.localdomain localhost satellite
> 
> I haven't touched the file. It was setup by the Kubuntu installer, I guess.
> 
> The /etc/resolv.conf looks like this:
> 
> domain odoepner.net
> nameserver 192.168.1.1

try adding

search odoepnet.net 

to the resolv.conf file it establishes a searchlist and your local hosts
file will now pick up.  The only other way is to make your local DNS
more than caching (add some entries per host).
domain option only provides the local domain name

If you are using DHCP - you may want to add steps to add these back upon
interface up. :)  They usually get whacked by the DHCP records.

Most distro now have a ifup.local and ifdown.local  you may need to
create it.  


Rich



!DSPAM:45e0b568273661929715185!




More information about the nSLUG mailing list