This blog includes subject like Computer Organization, Microprocessor, Digital Electronics, System Programming

Pages

This blog includes subject like Computer Organization, Microprocessor, Digital Electronics, System Programming

Powered by Blogger.

Sunday, August 18, 2019

Write a program for DNS lookup. Given an IP address input, it should return URL and vice versa.


#Write a program for DNS lookup. Given an IP address input, it should return URL and vice versa.

import socket
print  'Welcome for DNS lookup URL to IP Address'
URL=raw_input('Please enter URL: ')

addr1 = socket.gethostbyname(URL)

print(addr1)
print  'WelCome for DNS lookup IP address to URL'
IP=raw_input('Enter IP Address: ')
addr6=socket.gethostbyaddr(IP)
print addr6

0 comments:

Post a Comment