1

我正在使用 Python 3.4、PyInstaller (3.0) 和 dnspython3 (1.12.0)。我的脚本运行良好

from dns import resolver,reversename

try:
    host_IP = resolver.query('www.google.ca', 'A')
    print(host_IP[0])
except:
    print('Not found !!')

try:    
    addr = reversename.from_address('8.8.8.8')
    host_name = resolver.query(addr,"PTR")[0].to_text()
    print(host_name)
except:
    print('Not found !!')

它返回

74.125.225.31
google-public-dns-a.google.com.

当我编译脚本时,我收到了警告

... 
5350 INFO: Processing hook   hook-dns.rdata.py   
5366 WARNING: Hidden import 'dns.rdtypes.*' not found (probably old hook)
5366 WARNING: Hidden import 'dns.rdtypes.ANY.*' not found (probably old hook)
...

运行 .exe 文件,它返回

\# 4 4a7de117
\# 32 13676f6f676c652d7075626c69632d64 6e732d6106676f6f676c6503636f6d00

有谁知道如何解决这一问题?我试图将这些包含在我的脚本中,但它也无济于事:

from dns.rdtypes import *
from dns.rdtypes.ANY import *

我是菜鸟!谢谢你。

4

0 回答 0