DNS name resolution using Python
Script I used to resolve DNS name to IP.
'''
NetOps
Given url find out the IP address of it
Devang Patel
'''
import socket
ip_add = 'Not a valid name'
try:
ip_add = socket.gethostbyname('www.google.com')
except socket.gaierror as e:
print(e)
print(ip_add)
Output:
172.217.6.68