def checkIpName(arg):
cmd = 'nslookup %s' % arg.strip()
handle = Popen(cmd, stdout = PIPE, stderr = PIPE, shell = True).stdout
re_handle = handle.read()
handle.close()
# name 关键词
botkey = ['baidu','google','yahoo','msn']
if re.search('Name',re_handle):
for bk in botkey:
checkkey = re.search(bk,re_handle)
if checkkey:
print "%s-%s\n" % (arg.strip(),bk)
break
cmd = 'nslookup %s' % arg.strip()
handle = Popen(cmd, stdout = PIPE, stderr = PIPE, shell = True).stdout
re_handle = handle.read()
handle.close()
# name 关键词
botkey = ['baidu','google','yahoo','msn']
if re.search('Name',re_handle):
for bk in botkey:
checkkey = re.search(bk,re_handle)
if checkkey:
print "%s-%s\n" % (arg.strip(),bk)
break