UPDATE

上级 7c4354ad
import subprocess
# # 安装dnsutils
# subprocess.run(["apt-get", "install", "dnsutils" " -y"])
# 假设你要查询的域名是example.com
domain = "example.com"
# 使用subprocess运行dig命令并获取输出
result = subprocess.run(["dig", domain], capture_output=True)
# 输出结果
print(result.stdout.decode('utf-8'))
\ No newline at end of file
......@@ -11,10 +11,12 @@ user_input = st.text_input('输入域名http://')
if user_input != '':
st.write('正在解析:,', user_input, '......')
# 定义dig命令
dig_cmd = ['sudo apt-get install dnsutils']
# result = subprocess.run(["python", "dig.py"],capture_output=True)
# 假设你要查询的域名是example.com
# domain = "example.com"
# 执行dig命令
result = subprocess.run(dig_cmd, capture_output=True, text=True)
# 使用subprocess运行dig命令并获取输出
result = subprocess.run(["dig", "+noall", "+answer", user_input ], capture_output=True)
# # 输出dig命令的结果
# print(result.stdout)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册