[CentOS] Finding DHCP IP of guest system

Sat Jul 17 01:59:55 UTC 2010
Jay Leafey <jay.leafey at mindless.com>

I had the same issue on my local network (DHCP server could not update 
DNS) so I cobbled up a shell script that runs periodically to update DNS 
manually.  It does a ping-sweep using "nmap -sP 192.168.1.0/24" and 
parses the output.  The output (obfuscated and abbreviated) looks like this:

> Starting Nmap 4.11 ( http://www.insecure.org/nmap/ ) at 2010-07-16 20:53 CDT
> Host 192.168.1.1 appears to be up.
> MAC Address: **:**:**:**:**:** (Unknown)
> Host 192.168.1.2 appears to be up.
> MAC Address: **:**:**:**:**:** (Compaq Computer)
> Host workstation.local (192.168.1.5) appears to be up.
> MAC Address: **:**:**:**:**:** (Hewlett Packard)
> Host printer.local (192.168.1.9) appears to be up.

In my case, I added the MAC address/DNS name pairs in /etc/ethers and 
use that to drive the process.  I've even got a few VMware hosts with 
bridged interfaces, they work the same as the physical machines.

Admittedly, it's a heck of a kludge.
-- 
Jay Leafey - jay.leafey at mindless.com
Memphis, TN
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/x-pkcs7-signature
Size: 3274 bytes
Desc: S/MIME Cryptographic Signature
URL: <http://lists.centos.org/pipermail/centos/attachments/20100716/349fa677/attachment-0005.bin>