How to reach a computer by hostname on a LAN?

Kam Leo kam.leo at gmail.com
Wed Dec 29 08:38:55 UTC 2004


On Wed, 29 Dec 2004 00:04:43 -0800, Kam Leo <kam.leo at gmail.com> wrote:
> On Tue, 28 Dec 2004 23:53:58 -0800, Kam Leo <kam.leo at gmail.com> wrote:
> > On Wed, 29 Dec 2004 01:10:53 -0600, Christopher J. Bottaro
> > <cjbottaro at alumni.cs.utexas.edu> wrote:
> > > Jason Powers wrote:
> > >
> > > > 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 192.168.1.100
> > > > 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.
> > > >
> > > > Jason
> > > >
> > > > Christopher J. Bottaro wrote:
> > > >> Simple setup.  I have a router that assigns IP addresses by DHCP.  I have
> > > >> two linux machines:  compa and compb which get their IP addresses using
> > > >> DHCP with the router.  From compa, I want to be able to say "ping compb"
> > > >> instead of having to use ifconfig on compb to figure out what its IP
> > > >> address is, then ping it (i.e. "ping 192.168.1.3").
> > > >>
> > > >> How is this possible?  Manually editing the /etc/hosts file doesn't work
> > > >> because the IP addresses can change at boot (or whenever DHCP is used to
> > > >> get a new address).
> > > >>
> > > >> Thanks.
> > >
> > > Thanks for the great reply.  I have a couple of problems though...
> > >
> > > It seems my router does what I want (I think).  It it setup as a DHCP
> > > server.  I have 3 computers:
> > > semaphore (linux)
> > > mutex (winxp)
> > > mobile (linux, wireless)
> > > When I go to "connected devices" in my router setup, I see 3 entries:
> > > --- 192.168.1.100
> > > SEMAPHORE 192.168.1.101
> > > --- 192.168.1.102
> > > Problem number 1:  Why isn't mutex and mobile giving their hostnames to the
> > > router?
> > > Problem number 2:  "ping semaphore" from mutex (the winxp machine) works,
> > > but "ping semaphore" from mobile gives me "unknown host".  What is up with
> > > that?  Why can the win32 machine resolve semaphore properly and the linux
> > > machine doesn't?
> > >
> > > Its a Netgear WGR614v5 router, btw.
> > >
> > > Thanks for the help, I can't wait to get this problem licked...I've been
> > > wanting to solve it for a long time.
> > >
> >
> > Verify following are in /etc/sysconfig/network in each of your linux boxes:
> >
> > # /etc/sysconfig/network
> > NETWORKING=yes
> > HOSTNAME=hostname_of_your_system
> >
> 
> I forgot to mention that you should also verify in /etc/hosts that you
> have the hostname as an alias for address 127.0.0.1 .
> 

It's getting really late and I'm not thinking as clearly as I should. 
Need to get to bed.

You also need to check /etc/sysconfig/network-scripts/ifcfg-eth0. 
Change eth0 to eth1 or whatever your network connection to dhcp is.

#/etc/sysconfig/network-scripts/ifcfg-eth0
DEVICE=eth0
BOOTPROTO=dhcp
ONBOOT=yes
TYPE=Ethernet
DHCP_HOSTNAME=hostname_of_your_system

DHCP_HOSTNAME should be there.  If not add it.  This should do the trick.  

I believe that DHCP_NAME is set up by kudzu when you do your install
of Fedora; however, the setup is easy to miss.

> > Get your router to refresh its status and see if the names appear.
> >
> > -- Kam Leo




More information about the fedora-list mailing list