我想运行" host domain.com"通过获取URL
UIColor.white
答案 0 :(得分:0)
列表中的网址:
os.system("host %s | grep 'has address' | sort -u" % (url))
答案 1 :(得分:0)
enter code here
#!/usr/bin/python
import subprocess
list = ("/root/cisco/indexlist.txt","r")
for hostname in list:
p1 = subprocess.Popen(['host', hostname],stdout=subprocess.PIPE)
p2 = subprocess.Popen(['grep', 'IP ADDRESS'], stdin=p1.stdout, stdout=subprocess.PIPE)
p3 = subprocess.Popen(['sort','-u'],stdin=p2.stdout, stdout=subprocess.PIPE)
print (p3.communicate()[0])