Reverse DNS lookup is used by email servers to validate and block spam email messages. If the rDNS check fails, then Email servers by default mark the incoming messages as SPAM. Most of the time, email servers automatically reject the messages from an IP address that does not contain rDNS in place. Therefore, if you need to add an rDNS, you can contact your hosting or IP provider to do it.
In this article, we will explain how you can perform the reverse DNS lookup process in Linux through the command line environment.
There are three different commands available in the Linux system that can be used to perform the rDNS lookup process:
- dig Command: Domain Information Groper, which is known as dig, is useful for observing DNS name servers.
- host Command: host is a command-line utility used for performing the DNS lookups. It converts the hostnames to IP addresses and vice versa.
- nslookup Command: Nslookup is used to examine Internet domain name servers.
Perform the Reverse DNS Lookup Using the dig command
Using the dig command, you can easily perform the rDNS lookup manually through the terminal and show answers that are returned from the name server(s) that were examined. This command gives flexible and clear output, which is the main reason DNS administrators used the dig command to resolve the DNS problems. Use the following command to perform the rDNS lookup in Linux:
$ dig –x 10.0.2.15
Perform Reverse DNS Lookup Using the host command
Host utility converts the names to IP address and vice-versa, as we have discussed above. To perform a DNS lookup using the host command, type the following command:
$ host 10.0.2.15
Perform Reverse DNS (rDNS) Lookup Using the nslookup Command
The nslookup is the most commonly used network administration tool that helps check and resolve DNS-related problems. It has two different modes for displaying the output: interactive and non-interactive mode.
The interactive mode displays the information about various hosts and domains against the query. In the non-interactive mode, it only shows the name and relevant requested details for a domain. Use the following nslookup command to display the information about the given IP address:
The reverse DNS lookup is a straightforward method to ensure that the IP address does belong to the specified domain. So, using the above-mentioned commands, you can easily display the rDNS lookup information of a given Ip address. Please, send your query via comments.