GNU/Linux: getting value of option 15 of DHCP without using `getnameinfo`
My GNU/Linux machine is connected to a DHCP. I want to retrieve the value of the option 015 of DHCP 开发者_JAVA百科(DNS Domain Name), but without using getnameinfo
, since it is using DNS in order to retrieve domain name.
How can I do that with C/C++?
My dhclient
writes a pile of lease information into /var/lib/dhcp3/dhclient-[uuid]-[iface].lease
files. I haven't got a clue what the uuid in those filenames represents, but it does report the different options from the dhcp server.
Fore SUSE: DHCP options are written in /var/lib/dhcpcd/dhcpcd-eth[x].info
精彩评论