In this short guide, we have explored a few ways to performs Reverse DNS lookup and get a domain name from an IP address. For demonstration purposes, I have used Ubuntu 20.04.
Prerequisites
Before you roll up your sleeves, ensure that your remote host has an A record which is a DNS entry that points or maps a domain name to an IP address
Perform DNS Reverse lookup using dig command
Dig command is a flexible and powerful tool that is used for querying or probing DNS records. It’s an acronym for domain information groper and allows you to retrieve a wide array of DNS information such as A, CNAME, MX, and SOA records.
Perform DNS Reverse lookup using nslookup command
A nslookup command is a troubleshooting tool that features highly in a sysadmin’s armory. It’s a versatile tool that performs all DNS record querying such as CNAME, A, MX, and reverses or PTR records.
To retrieve a domain name from an IP address, use the command syntax:
For example.
Perform DNS Reverse lookup using the host command
Similarly, you can use the host command to obtain a hostname or domain name from an IP address using the syntax as shown.
For example, to check the domain name for the IP 5.9.235.235, execute the command:
Just like the Nslookup command, you can also use the host command with hostnames or IP addresses.
Conclusion
The few examples that we have just elaborated are a sure way of helping you obtain the domain name from an IP address. Usually, the reverse DNS lookup is trivial and not as crucial as the forward lookup, which maps domain names to IP addresses. Your feedback or contribution will be highly welcomed.