[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

Re: How to reach a computer by hostname on a LAN?

On or about 2004-12-28 01:02, Jason Powers whipped out a trusty #2 pencil and scribbled:

Is your router also handing out the hostnames? In that case, can it be activated as a DNS? I usually recommend the common cheesy blue linksys routers to my users, and I know they can do that, I assume others can.

The host map or host table (DNS) is like the White Pages, it's what your computer uses to look up IPs for hostnames and hostnames for IPs.

The DNS your ISP hands you is their copy of the public one, but you are running a local domain (the 192.168.1.x subnet) which their server will not have - your internal hostnames are not listed in their phone book, and won't be.

Normal DHCP config hands out DNS as well as IP, so the router gets it from your ISP and gives it to the machines. Most routers will let you use them as a DNS, so you can tell it to keep a table and then append the router as one of the DNS it assigns to your linux boxes.

You'll probably want to look up the configuration process in the instruction manual BEFORE you try to set it, because if you make a mistake you won't be able to see the internet until you fix it, so download the documentation now if you don't have the booklet.

Alternatively you can alter one of the machines to be a DNS but then you have to assign it manually in the other machine or in the router, it's easier if there are only 2 or 3 machines to use the router if it is capable.

While you're in the router, change its internal address to and have it assign IPs starting with .101, .102, etc. leaving it at .1 is not as bad as keeping the factory default password, but it's still asking for trouble.


WIth only 2 machines I would be inclined to just configure the machines to not use DHCP, assign the IP address on each machine and build the corresponding /etc/hosts file. On the other hand, if you have a switch set up with extra ports, it can be nice to have DHCP for the times when your friend comes over and wants to plug in his laptop.

The full solution Jason gives is fine, if your router has all the features needed.

You can have a little of both worlds, though. Most routers that provide DHCP allow you to specify a set of hard-coded (by MAC address) IP addresses which will always be given to those machines when they request an address. So you can build a hosts file and copy it to all the machines. You can also tell the router to assign an IP address from a certain range for machines which request an address and their MAC address is NOT in the table you provided it.

Fritz Whittington
It is not worth an intelligent man's time to be in the majority. By definition, there are already enough people to do that. (G. H. Hardy)

Attachment: smime.p7s
Description: S/MIME Cryptographic Signature

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]