Definition: Forward lookups

Hopefully you’ll never need to have this explained to you, but a forward lookup is a DNS query that translates a hostname into an IP address.  A forward lookup can return many different record types, not all of which are IP addresses.

In DNS terminology this is going to result in a response which is an A record, an AAAA record, a CNAME, or an NX response.  There are other types of records, but since there’s no documentation on this site that talks about them, we’re leaving them out.

An A record is an address record that specifies an IPv4 address, like 127.0.0.1.

An AAAA record is an address record that specifies an IPv6 address, like ::1/128.

An NX response is a negative lookup, which basically means “No, that name doesn’t exist.”  An NX record means that you’re out of luck, and there’s no point in asking anyone else about it.

A CNAME is a special kind of response that means in essence that the resource exists, but it’s called something else.  It points to another record, which then has to be looked up.  One very common example would be a lookup for foo.com that has a CNAME response that means “No, we call that www.foo.com“.  To turn that into an IP address, a follow-up query for www.foo.com will need to be made.  A CNAME is also special in that while most names can have both A and AAAA records (as well as NS records, SRV records, TXT records, and a few others we’re not mentioning)  associated with them, a CNAME is a singleton record which will always be the only response returned because both the name and the target of the CNAME are meant to be entirely the same.

You may also like...