[COLUG] Lan hostname to IP resolution

David McGlone d.mcglone at att.net
Fri Feb 22 19:23:12 EST 2008


On Friday 22 February 2008 5:24:59 pm Richard Holbert wrote:
> David,
>
> You'll probably have to use some combination of DHCP and DNS.  You might
> be able to configure your router to issue an IP address based on the MAC
> address of your individual computers. If not, turn off DHCP in your
> router, and set up your own DHCP server.
>
> The following link will get you started:
>
> <http://www.brennan.id.au/10-DHCP_Server.html>
>
> If not, google is your friend. You can also set up your own caching DNS
> server.
>
> Rick
>
> david riggs wrote:
> > I  have several Linux machines plugged in, or wirelessed into, my
> > Verizon ADSL router.
> >
> >
> > I just want to be able to from one machine  issue e.g.
> >
> > "scp -pr project1 my-etch1:"
> >
> > in order to make a quickie copy of one folder into my home folder on the
> > other machine (hostname of "my-etch1") rather than find out and type in
> > the full IP each time.
> >
> >
> > The ip address (192.168.1.X) varies from time to time as the links come
> > up and down, so I cannot just put something like "192.168.1.68
> > my-etch1" into /etc/hosts.

The reason is because you need to turn off dhcp so your router does not assign 
each computer and IP. Then you need to assign each computer its own IP. 
> >
> > What is the best (or easiest?) way to set up so that the system can
> > figure out for itself the IP address for each machine (as it changes
> > over the days).

Here's how I do it for several computers:

1. I turn dhcp on the router off.
2. I then assign my network card on each computer it's own IP (192.168.x.x) 
depending on what your router calls for. My routers IP is 192.168.2.1 so I 
assign each computer starting with 192.168.2.2 and move on up ie: 2.3, 2.4, 
2.5 etc.
3. I then edit /etc/hosts and put every computer I have on the network into it 
and associate it with a hostname.

That's all. You should now be able to access every computer on the LAN.

-- 
David M.


More information about the colug432 mailing list