[nSLUG] hostname, /etc/hosts, DHCP
odoepner at gmail.com
Fri Feb 23 21:36:47 AST 2007
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
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:
When I was asked for a local domain during the installation I entered
"odoepner.net", just for fun. I have also specified that same domain for
the local network in the router configuration.
But I don't know if that makes sense at all. For example if I do "host
satellite" I get a "Host satellite not found: 3(NXDOMAIN)".
When I am online over wlan0 then "host satellite-wlan0" yields
"satellite-wlan0.odoepner.net has address 192.168.1.30".
It seems that my local hostname has no meaning at all.
Anyways, I am quite tired now. Maybe someone can make some enlightening
comments on how things are done right in my scenario.
More information about the nSLUG