-
Notifications
You must be signed in to change notification settings - Fork 148
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
系统DNS配置问题 #184
Comments
|
没有这样的网络连接,只有我自己配置的127.0.0.1和::1,还有一些连接的DNS是
,其他都没有DNS服务器这一项。 |
如果方便,请提供以下信息:
def get_dns_servers():
import ctypes, ctypes.wintypes, struct, socket
DNS_CONFIG_DNS_SERVER_LIST = 6
buf = ctypes.create_string_buffer(2048)
ctypes.windll.dnsapi.DnsQueryConfig(DNS_CONFIG_DNS_SERVER_LIST, 0, None, None, ctypes.byref(buf),
ctypes.byref(ctypes.wintypes.DWORD(len(buf))))
ipcount = struct.unpack('I', buf[0:4])[0]
return [socket.inet_ntoa(buf[i:i + 4]) for i in range(4, ipcount * 4 + 4, 4)]
print(get_dns_servers()) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
我把DNS服务器配置成优先使用系统DNS
同时系统DNS只有一个本机


127.0.0.1
,但是运行程序的时候就显示有三个系统DNS这是为什么呢?
The text was updated successfully, but these errors were encountered: