Tuesday, May 7, 2024
 Popular · Latest · Hot · Upcoming
14
rated 0 times [  14] [ 0]  / answers: 1 / hits: 76249  / 2 Years ago, wed, july 20, 2022, 7:06:33

On my LAN there are multiple DHCP servers running, and all of them are on the same range.



Now I use a machine which has a dynamic IP address from a DHCP server. I have to know from which server it comes.



How to do that?!


More From » networking

 Answers
4

To find out the DHCP server that's giving you the IP, just press Ctrl+Alt+T on your keyboard to open Terminal. When it opens, run the command(s) below:



cat /var/lib/dhcp3/dhclient.leases


Or you can just use grep command to get DHCP server address.



grep dhcp-server-identifier /var/lib/dhcp3/dhclient.leases


OR



grep dhcp-server-identifier /var/lib/dhcp/dhclient.leases


For Ubuntu 14.04, 16.04, and 17.10 you can use:



dhclient -d -nw eth0


Sample output:



Internet Systems Consortium DHCP Client 4.2.4
Copyright 2004-2012 Internet Systems Consortium.
All rights reserved.
For info, please visit https://www.isc.org/software/dhcp/

Listening on LPF/eth0/00:0c:29:49:3e:67
Sending on LPF/eth0/00:0c:29:49:3e:67
Sending on Socket/fallback
DHCPDISCOVER on eth0 to 255.255.255.255 port 67 interval 3 (xid=0x4f723f9)
DHCPREQUEST of 192.168.138.136 on eth0 to 255.255.255.255 port 67 (xid=0x4f723f9)
DHCPOFFER of 192.168.138.136 from 192.168.138.254
DHCPACK of 192.168.138.136 from 192.168.138.254
RTNETLINK answers: File exists
bound to 192.168.138.136 -- renewal in 892 seconds.

[#27189] Thursday, July 21, 2022, 2 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
edseager

Total Points: 185
Total Questions: 105
Total Answers: 102

Location: Angola
Member since Wed, Apr 13, 2022
2 Years ago
;