Hi Doug, And thanks for your input. Unfortunately I can't modify any DCHP config settings in the router (that I know of anyway), so I have to find a way to either get the Linux PCs to report their host names to the router or have the router find the hostname from the PC. When booted in Windows they do that but in Linux they do not. Of course I can always go back to a static IP and I might just ultimately do that, but I'd like to know if there is a way to make this work. Thanks again! -- Gary ----- Original Message ----- From: "doug waud" <douglas.waud@umassmed.edu> To: <wlug@mail.wlug.org> Sent: Saturday, November 10, 2001 3:32 PM Subject: Re: [Wlug] DCHP Private IP Hostname Resolution
Hi again (with a red face!)
Sure, but the IPs are dynamic so the hosts file is out, right?
Missed that (another "senior moment")! :-( Now I remember one reason I have been using static IP addresses :-)
One way to cheat a bit would be to assign addresses but tie them to the MAC address of the ethernet card of each box, i.e. add something like
host box1 { hardware ethernet 00:A0:CC:E4:86:CD; fixed-address 192.168.1.222; }
to /etc/dhcpd.conf
Then you could use the /etc/hosts route. Not an elegant solution but, what the hell, this is a rear-guard action :-)
Unfortunately I have no dhcpd server running so I cannot test the following, but include it as a potential more elegant solution [and also as an attempt at face-saving :-) ]
I believe there should be a file /etc/dhcpd.leases with sections like
lease 192.168.1.25 { starts 2 2001/07/31 15:23:47; ends 3 2001/08/01 03:23:47; hardware ethernet 00:a0:cc:e7:6a:b9; uid 00:A0:CC:E4:86:CD; client-hostname "box3"; }
If so with some cat|awk|grep|sed piping you should be able automatically to extract the dotted quad which goes with each host and give the former to ping to chew on.
As I say, I can't test this. However, if you are masochistic enough to want to continue this thread, feel free to send me a sample copy of that /etc/dhcpd.leases file and I'll see if I can get a short shell script you could try instead of ping.
On the more positive side, at least you now know the dangers of posting a query :-)
doug -- Douglas R Waud, Professor Emeritus -- Pharmacology University of Massachusetts Medical School Mailing address: 17 Lantern Lane, Shrewsbury, MA 01545-2006 _______________________________________________ Wlug mailing list Wlug@mail.wlug.org http://mail.wlug.org/mailman/listinfo/wlug