开发者

How to set DNS Servers on Router from OSX Client?

开发者 https://www.devze.com 2023-03-11 16:29 出处:网络
I want to set the dns servers that my router will hand out to a开发者_如何学运维ll clients from a program running on osx. Is there any native way to do this. Does osx provide any uPNP wrapper apis. I

I want to set the dns servers that my router will hand out to a开发者_如何学运维ll clients from a program running on osx. Is there any native way to do this. Does osx provide any uPNP wrapper apis. I have seen some 3rd party apis for uPNP like minipnp etc, but would prefer to use the OS if available.

It seems from people I have talked to that "DNSServiceNATPortMappingCreate" will do uPNP nat port forwards. So should I assume DNSServiceAddRecord would do the same?


You've no chance.

Many routers don't even support overriding the DHCP DNS settings from their own GUI, let alone from uPNP. See Section 5 of RFC 5625 for the gory details on how DHCP and DNS interact on routers.

The only practical solution is to run your own DHCP server, and turn off the one on the router. If your OSX machine is your network server you can easily install ISC DHCPD from the MacPorts project.


Well it turns out the best and only option is router screen scraping, yucky, but works.

0

精彩评论

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