How To Get A Reverse DNS Lookup On The Command Line
erics, September 1st, 2021
There are three commands in Linux to easily get a reverse DNS lookup with: dig, host and nslookup. Here are examples of each: shell> dig -x 3.214.2.238 +short
1 |
ns3.wyzaerd.info. |
shell> dig -x 3.214.2.238
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 |
; <<>> DiG 9.8.2rc1-RedHat-9.8.2-0.68.rc1.86.amzn1 <<>> -x 3.214.2.238 ;; global options: +cmd ;; Got answer: ;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 19300 ;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 0 ;; QUESTION SECTION: ;238.2.214.3.in-addr.arpa. IN PTR ;; ANSWER SECTION: 238.2.214.3.in-addr.arpa. 300 IN PTR ns3.wyzaerd.info. ;; Query time: 8 msec ;; SERVER: 10.0.0.2#53(10.0.0.2) ;; WHEN: Wed Sep 1 19:43:56 2021 ;; MSG SIZE rcvd: 72 |
shell> host 3.214.2.238
1 |
238.2.214.3.in-addr.arpa domain name pointer ns3.wyzaerd.info. |
shell> nslookup 3.214.2.238
1 2 3 4 5 |
Server: 10.0.0.2 Address: 10.0.0.2#53 Non-authoritative answer: 238.2.214.3.in-addr.arpa name = ns3.wyzaerd.info. |