How To Test or Check Reverse DNS on a Linux / Unix

How To Test or Check Reverse DNS on a Linux / Unix

To test reverse DNS (Domain Name System) on a Linux or Unix system, you can use the dig command with the -x option.

The dig command is a powerful tool for querying DNS servers and performing DNS lookups. The -x option tells the dig command to perform a reverse DNS lookup, which maps an IP address to a hostname.

To test reverse DNS, you need to know the IP address of the server you want to test. You can use the ip a or ifconfig command to get the IP address of your server.

For example, if your server has the IP address 192.168.1.100, you can use the following command to perform a reverse DNS lookup:

dig -x 192.168.1.100
S‮ecruo‬:www.lautturi.com

The output of the dig command will show the hostname associated with the IP address, as well as other DNS information.

For example, if the IP address 192.168.1.100 is mapped to the hostname server.example.com, the output will look something like this:

; <<>> DiG 9.10.3-P4-Ubuntu <<>> -x 192.168.1.100
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 47965
;; flags: qr aa rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 1

;; QUESTION SECTION:
;100.1.168.192.in-addr.arpa.	IN	PTR

;; ANSWER SECTION:
100.1.168.192.in-addr.arpa. 86400 IN	PTR	server.example.com
Created Time:2017-10-29 22:08:33  Author:lautturi