Retrieve IPv4 and IPv6 nameservers programmatically

谁说胖子不能爱 提交于 2019-12-02 10:10:24

You really should not access the _u._ext parts of the resolver state, they are an internal implementation detail. The nscount6 member is currently unused and always zero. It had to be kept to avoid changing the ABI as the result of struct offset/size changes.

If you need the nameserver list, you should parse /etc/resolv.conf yourself. Note that eventually, glibc will also support more than three name servers, and those extra resolvers will not be reflected in the public resolver state.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!