Programmatically Changing NameServer in Windows TCP/IP
问题 I am building a VPN application where I need to set DNS server programmatically. I am changing NameServer parameter in the registry (in HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters\Interfaces ) to prepend a name server to the list of existing entries. Once I do this, if I try to look up a host name using nslookup , it works fine, but ping is not able to resolve the name - for 15 minutes. And after 15 mins ping is also able to resolve the name. I've tried my own little