A python tool for querying the Domain Name System (DNS) to obtain the mapping between domain name and IP address, or other DNS records. In addition, this tool supports reverse mapping.
pip install scapy
python nslookup.py <domain name>
or
python nslookup.py -type=PTR <ip address>