开发者

GNU/Linux: getting value of option 15 of DHCP without using `getnameinfo`

开发者 https://www.devze.com 2023-02-07 17:57 出处:网络
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 r

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

0

精彩评论

暂无评论...
验证码 换一张
取 消