A lot of times I need to see if a host's reverse DNS matches the A record it's associated with. So, what I do is nslookup superuser.com followed by nslookup 64.34.119.12. Is there a way to get nslookup to do this in one step?
4 Answers
Do you mean something like
nslookup -type A superuser.com
source: Microsoft Technet
This will give you the following as an output
Server: stackoverflow.com
Address: 64.34.119.12
Non-authoritative answer:
Name: A
Address: 67.215.65.132
- 1,195
- 6
- 15
Unfortunately, the PTR and A records are on different servers. The owner of the domain will have name servers for the A record. Smaller users will have IP addresses provided by a separate organization. That organization will have have their own name servers for the PTR records. Even where both were on the same servers, different queries are required. Even zone transfers would not work as the data is in different zones.
If you are repeating the same lookups, which is common if you are running an MX mail server, consider setting up a caching nameserver on the same host. A program like dnsmasq provides a light-weight caching name server with a limited (but configurable) cache size. However, dnsmasq doesn't run on Windows. Running bind, which is available for Windows, as a caching name server provides full functionality at the expense of a possibly more complicated configuration. In either case, the name server cache should not be accessible from the Internet, but must be able to query the Internet.
- 10,899
- 2
- 25
- 24
-
This sounds like an answer to an entirely different question. The questions seems to have been more along the lines of *"I don't want to type two commands, I'd rather type one command. Is there such a combined command?"*. – StackzOfZtuff Apr 10 '18 at 12:18
There is also a utility by Nirsoft that performs this lookup on Windows.
- 101
-
Your answer could be improved with additional supporting information. Please [edit] to add further details, such as citations or documentation, so that others can confirm that your answer is correct. You can find more information on how to write good answers [in the help center](/help/how-to-answer). – Community Feb 22 '22 at 16:58
Sounds like you're talking about a Forward Confirmed Reverse Dns Lookup.
That isn't possible in one step with nslookup.
We've built an online tool that does do it in one step:
Misk.com - DNS Lookup.
Just enter an ip address. It does a PTR lookup first, then an A/AAAA lookup, and tells you if they match.
- 101
- 1