Finding DNS server settings programmatically on Mac OS X

前端 未结 5 1672
醉话见心
醉话见心 2020-12-10 18:55

I have some cross platform DNS client code that I use for doing end to end SMTP and on windows I can find the current DNS server ip addresses by looking in the registry. On

5条回答
  •  臣服心动
    2020-12-10 19:08

    You can use the SystemConfiguration framework. It's in C.

    Update: apparently the rest of the web is harder to use than I thought. Search for the key "State:/Network/Service/ServiceID/DNS" where ServiceID is the ID of the service.

提交回复
热议问题