0

My reading of dig's manpage isn't answering this question. Is there a set of command-line options to dig such that I can type

dig $WHATEVER my-aname.example.com

and have it do a forward lookup for that host's IP and then have it reverse-resolve that IP to the server's canonical name(s)?

Kevin Riggle
  • 103
  • 1
  • 6

1 Answers1

1

You can't do that in a single lookup. In any event the definition of a canonical hostname is not as well defined as you would need.

For example, the right-hand side of a CNAME record was originally supposed to point to a canonical name, but often doesn't (so-called "CNAME chaining").

An IP address can also have multiple PTR records, there's no requirement that there be one (singular) canonical name for an IP address.

Alnitak
  • 334,560
  • 70
  • 407
  • 495
  • Edited question to reflect that. I'm not trying to use the information programmatically, I'm just looking at the output, so I don't really need a single canonical name, just the usual output of the reverse-resolve. But I hadn't known that IPs could have multiple PTR records -- thanks! – Kevin Riggle Aug 13 '12 at 20:54