What is DNS? Why does it matter?
THis is a python script which will help you to get the DNS records of a domain.
DNS stands for Domain Name System. It is a system that matches domain names to IP addresses. It is like a phone book for the internet. When you type a domain name into your browser, the DNS system looks up the IP address of the server that hosts the website.
DNS is important because it is the backbone of the internet. Without DNS, you would have to remember the IP address of every website you want to visit. DNS makes it easy to remember domain names and access websites quickly.
This script uses the socket module in Python to get the DNS records of a domain. You can run this script from the command line and pass the domain name as an argument. For example:
python dns_record.py google.comThis will print the DNS records of the domain google.com.
Make it general, so that it can be used from within another program.
This script takes the website name as input and returns its dns records.
External library called dnspython has been used here and it can be installed easily by using the following command:
Contents of requirements.txt:
dnspython==2.0.0
pip install -r requirements.txt
1.Install the requirements.
- Type the following command
python dns_record.py
3.It will ask for a website:
You can give any website name for example: google.com