2

What is the actual difference between a Host record and an A record? Both points to an IP so what is the difference?

migrated from networkengineering.stackexchange.com Jun 19 '15 at 18:30

This question came from our site for network engineers.

8

There is no such thing as a Host record in the actual DNS specification. Host records are generally a logical construct in DDI (DNS, DHCP, and IPAM) solutions like Infoblox and others. They comprise various DNS record types (A, AAAA, PTR, CNAME, etc) and other metadata associated with a "host".

3

A records and AAAA records are "address records" (hence the "A") that map a hostname to an IP address. So, when you create an "A record" for example.com, you map that to an IP address, ex. 1.2.3.4. Because of that hostname -> IP mapping, some people refer to those records as "host records".

AAAA records are the same concept, except for IPv6 128-bit addresses. A records are for IPv4 which are 32-bit addresses.

3

As others have stated, there is no such thing as a "host" record in the DNS specification. Most people confuse hostnames and DNS records because DNS is frequently used to store the relationships between hostnames and IP addresses, represented with A, AAAA, and PTR record types.

DNS is a lot more than that though:

  • DNS is a widely distributed, hiarchical database that can be used to store any number of things. It just happens to specialize in mapping names to IP addresses and vice versa, because that's what the internet needs most from such a database.
  • All hostnames are legal DNS labels. (label = the left hand side of a DNS record)
  • Not all DNS labels are legal hostname entities. This is where people get confused. Wikipedia covers this topic pretty well, but the short version is that there are many characters that will pass a syntax check for DNS that are not legal for use in hostnames. This is a pretty significant hint that DNS is not enslaved to the hostname specifications.

To wrap up and reinforce the above topics, I'm going to drop a hefty wall of text from RFC-2181:

  1. Name syntax

    Occasionally it is assumed that the Domain Name System serves only the purpose of mapping Internet host names to data, and mapping Internet addresses to host names. This is not correct, the DNS is a general (if somewhat limited) hierarchical database, and can store almost any kind of data, for almost any purpose.

    The DNS itself places only one restriction on the particular labels that can be used to identify resource records. That one restriction relates to the length of the label and the full name. The length of any one label is limited to between 1 and 63 octets. A full domain name is limited to 255 octets (including the separators). The zero length full name is defined as representing the root of the DNS tree, and is typically written and displayed as ".". Those restrictions aside, any binary string whatever can be used as the label of any resource record. Similarly, any binary string can serve as the value of any record that includes a domain name as some or all of its value (SOA, NS, MX, PTR, CNAME, and any others that may be added). Implementations of the DNS protocols must not place any restrictions on the labels that can be used. In particular, DNS servers must not refuse to serve a zone because it contains labels that might not be acceptable to some DNS client programs. A DNS server may be configurable to issue warnings when loading, or even to refuse to load, a primary zone containing labels that might be considered questionable, however this should not happen by default.

    Note however, that the various applications that make use of DNS data can have restrictions imposed on what particular values are acceptable in their environment. For example, that any binary label can have an MX record does not imply that any binary name can be used as the host part of an e-mail address. Clients of the DNS can impose whatever restrictions are appropriate to their circumstances on the values they use as keys for DNS lookup requests, and on the values returned by the DNS. If the client has such restrictions, it is solely responsible for validating the data from the DNS to ensure that it conforms before it makes any use of that data.

The last paragraph is particularly important. The DNS standards are very open ended in terms of what is legal to store within DNS, but other standards can dictate how a service consumes DNS and can impose any limitation on what an application should (and should not) expect to find there. This is exactly so in the case of hostnames, which are defined by RFCs outside of the DNS standards.

2

DNS specifies A records as one possible record type. A records are sometimes referred to as host records. They are the same thing, but I would prefer using "A record", since that is what it's officially called.

Did you encounter both concepts in a situation where they seem to mean a different thing? I know Infoblox DNS appliances support the concept of a 'host object', which is a data structure in their configuration which is translated into an A and a PTR record in the DNS server.

  • 1
    AAAA would also be a host record. – Jens Link Jun 19 '15 at 9:24
2

Yes, I was dealing with Infoblox. And you guys were correct - Host Record is an object created by Infoblox to create both A record and PTR record at the same time.

Also individual forwards and reverse lookup also can be created. Though a bit slow while searching a large database, Infoblox is good for a lot of things.

Thank You for the inputs. Learned a lot :)

  • "does not allow/create the reverse lookup" - Nope, that's incorrect. Infoblox most definitely does support creating reverse PTR records both directly or virtually via a Host record. In both cases a standard DNS PTR lookup will return the name for that IP. – Ryan Bolger Apr 28 '17 at 15:09
  • @RyanBolger Thank you for pointing out the error. I have corrected my answer. – PraveenMathew May 1 '17 at 7:58
0

The only real differentiation I have encountered between HOST records and A records is within Infoblox Grid Manager. In that application, you can distinguish between setting up either type of record.

There are a few additional options available when setting up an A record within Infoblox, but as far as the rest of the world is concerned, both records are interpreted exactly the same.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.