basic client setup plus name resolving from HW router

Simon Hobson dhcp at thehobsons.co.uk
Sat May 13 08:20:54 UTC 2006


Olivier Schreiber wrote:

>My question is so generic that I have trouble doing a search for it.
>
>I have a home lan with an SMC7004WBR wireless router.
>I installed Debian Linux a few months ago along with dhcp package
>and adjusting anything, I got leases for the two machines which
>had linux on it: `omnibook' and `kayak'.
>I did not spend the effort to try to find out how to address each
>machine from each other except by their IP addresses leased out by
>dhcp so I do:
>kayak$rlogin 192.168.123.144
>to access omnibook from kayak and
>omnibook$rlogin 192.168.123.148
>to access kayak from omnibook
>
>So now I want to set things up properly without hardcoding the /etc/hosts
>files with the IP addresses above to be able to do:
>kayak$rlogin omnibook
>to access omnibook from kayak and
>omnibook$rlogin kayak
>to access kayak from omnibook
>
>
>I am clueless about what additional package --if any-- I need to install
>to accomplish that.
>
>I have dhcp3-client and dhcp3-common
>I don't think I need dhcpcd because my understanding is that the
>hardware router is the dhcp server in my situation.
>But do I need autodns-dhcp? or bind9? or resolvconf?

There are two ways of referring to a host by name : dns and the hosts file.

In the early days of Unix & IP, all hosts were listed in a big hosts 
file. As the fledgling internet grew, this quickly because 
unmanageable and so DNS was developed.

Ordinarily, Dynamic DNS would be the preferred way to go, but this 
will NOT happen with your router as the dhcp server (I stand to be 
corrected, but I'm not aware of any home or small office router doing 
ddns). Using the ISC dhcp server, you can set things up so that the 
dhcp server will automatically update a dns server (BIND being 
preferred) as leases are created and expired.

It sounds like you may not have the skills to set up and run both the 
dhcp server and dns server, and from the description of your network, 
I would suggest it would be a bit of overkill. Also, it does require 
that one of your machines is left running all the time.

The first thing you should do it to make your machines have fixed 
addresses. Many routers have a means of fixing an address for a 
client - you give it the MAC address of the device and the IP address 
you want it to have. If your router cannot do this, then manually 
configure the machines with a fixed address.

NOTE: the fixed addresses you use must NOT be in the range that the 
router is able to allocate by dhcp.

Now, on each machine, add all the other machines to your /etc/hosts 
file, for example you might end up with :

127.0.0.1       localhost
192.168.123.144 omnibook
192.168.123.148 kayak

Now you should be able to refer to other machines by name.

Query to others - is there something needed in /etc/resolv.conf to 
query hosts file before dns ?

Any time you add or remove a machine from the network, you need to 
change the hosts file on every machine - you can see that it's 
trivial for a three machine network, but unmanageable by the time you 
get to three hundred or three thousand !


If you do want to do dhcp & dns with dynamic updates then ...

Firstly, welcome to the (far too small) group of people who care 
about running a network properly !

You need to have dhcp-server and bind installed (you do not need 
dhcp-client on the machine you use as the server).

On bind, configure a forward and reverse zone for your network (ie 
mydomain.com and 123.168.192.arpa).
<pet moan>
Do not just 'make up' a domain, or use ".local", or use a domain that 
someone else is using. Using .local is wrong - it's a reserved domain 
name for ZeroConf (cf Apple's Rendevous, multicast DNS, ...) and 
whilst Windows networks work fine with a .local address, Macs will 
barf and the network doesn't work right.
If you just 'make up' a domain name, at some point it could be 
registered by someone else - and then you would be using someone 
elses domain name.
Using someone elses domain name is just plain bad manners. Apart from 
not being able to access anything in their domain, the domain you use 
internally DOES leak out (eg in mail headers) and it's bad to be 
using someone elses name.

Getting your own domain name registered is so cheap and easy these 
days that there really isn't any excuse if you want to do things 
properly.
</pet moan>


Set up the dhcp server, and turn off the server in the router. Check 
that both dhcp and dns are working fine on their own.

Now read the section in 'man dhcpd.conf' that describes dynamic dns 
updates. If you have problems at that stage then come back and we'll 
try to help.

Simon


More information about the dhcp-users mailing list