If your linux machine is running on a dhcp enabled network , how do you identify the dhcp server name ?

Check out the file /var/run/dhclient-eth0.lease , replace the eth0 with you network interface name . The tag “dhcp-server-identifier” tells you the dhcp server name.

[root@linux-cloud ~]# cat /var/run/dhclient-eth0.lease
lease {
  interface “eth0”;
  fixed-address 192.170.1.3;
  option subnet-mask 255.255.255.0;
  option routers 192.170.1.1;
  option dhcp-lease-time 86400;
  option dhcp-message-type 5;
  option domain-name-servers 192.170.1.1;
  option dhcp-server-identifier 192.170.1.1;
  renew 0 2008/11/23 18:02:45;
  rebind 1 2008/11/24 03:55:08;
  expire 1 2008/11/24 06:55:08;
}
[root@linux-cloud ~]#

0 Shares:
Leave a Reply

Your email address will not be published. Required fields are marked *

You May Also Like