7

I am confused about domain names (I think)

I call these things, i.e. names you can buy, 'domain names'

bbc.co.uk
google.com

I call these things, i.e. extensions of names 'host names'

www.bbc.co.uk
mail.yahoo.com
arts.mit.edu
hello.there.example.com

Is this naming scheme correct? Are there official definitions of these?

In particular, what are each of the texts between the dots called (i.e. the name for "www", "bbc", "edu", "example")?

1
12

All of those entries are domain names per RFC 1034 and RFC 1035. If they also had the (typically implicit) trailing dot that represents the root they would be fully qualified domain names.

The individual components of a domain name are called labels. These cannot exceed 63 characters in length. A label can include any octet from \000 to \377.

If a domain name has an A (or AAAA) record associated with it (or a CNAME that ultimately resolves to an A / AAAA record) then it is also a hostname. Your three real examples (www.bbc.co.uk, etc) all qualify.

Special rules apply to hostnames. In particular, every label in a hostname must adhere to the RFC 1123 requirements, i.e. they can only use letter, digit, or hyphens, and hyphens cannot be the first or last character.

Please note that the leftmost label is not a DNS hostname in its own right, although it could be a local (non-DNS) hostname.

1
  • Wait. Aren't all of these are host names? Because for example when I write asdfasdfasdfasdfasdfasdfasdfa.com (that is, some gibberish), I am getting the dns_unresolved_hostname error. So that makes it look like all of these are actually hostnames. Could you clarify this one? – Utku Nov 5 '15 at 7:13
3

The right-most object is the Top Level Domain. Everything to the left of a TLD is a subdomain. If there is an address associated with the very left-most object it is considered a hostname.

7
  • 1
    And the thing as a whole, including the left-most part, is still a domain name. – mattdm Jan 13 '11 at 17:04
  • The left most part is commonly a record name that lies within the domain portion after it. Omitting the record name will bring up the default record, of the record type requested. – Chris S Jan 13 '11 at 21:24
  • @Chris - huh? DNS has no concept of a "default record". If you omit a leading label from a domain name that just means you're asking the same question but of that domain's parent domain. – Alnitak Jan 13 '11 at 22:07
  • @lain What does "if there is an address associated with the very left-most object" mean? Isn't an address always associated with these? – Utku Nov 5 '15 at 7:49
  • @Utku mx and CNAME RRs spring to mind. – user9517 Nov 5 '15 at 9:19
1

Is this naming scheme correct?

No

Are there official definitions of these?

The term, and command, 'hostname' in GNU/Linux is quite different from what I'll say below about what a hostname is.

In GNU/Linux a hostname is both a machine name and a network name in one. In other words it can be either a single label, or a set of labels connected by dots. It's used together with /etc/hosts for things like ssh.

But if you want to run a web server, it's not used, rather Apache is effectively pointed to by a DNS record, and then your Apache setup figures out which domain name you're serving.

BTW, the nearest thing to a GNU/Linux machine name (that is not a hostname) comes from `hostnamectl --pretty'.


1) hostname defined

The term 'hostname' dates back to 1985 or before, and so this term predates the DNS (the Domain Name Server) which comes later in 1987.

Initially there was one big text file of hostnames, which had a name column, and an IP address column, allowing one to lookup a name and find the associated IP address to the physical machine for that name.

As near as I can tell, there is no RFC which explicitly says hostnames are domain names (see note from WikiPedia below that says this is true, but without a reference).

But if you think about it, the DNS had to replace the simple text list. In other words, it had to do the lookup from name to IP, so I think the old hostname then became a domain name when DNS was created.

For clarity, today a machine name is NOT a domain name. While they might be the same or similar, they are not directly related, except that at first they were roughly the same thing back then. See Choosing a Name for Your Computer

  Avoid domain names.

     For technical reasons, domain names should be avoided.  In
     particular, name resolution of non-absolute hostnames is
     problematic.  Resolvers will check names against domains before
     checking them against hostnames.  But we have seen instances of
     mailers that refuse to treat single token names as domains.
     For example, assume that you mail to "libes@rutgers" from
     yale.edu.  Depending upon the implementation, the mail may go
     to rutgers.edu or rutgers.yale.edu (assuming both exist).

2) domain names defined

The internet was conceptualized with RFCs (Request for Comment documents), so the terminology is abstract not concrete. For example, domain and host are abstractions, while machine and computer are concrete things.

Before proceeding, I found that a review 'Tree Terminology' for the abstract definition for tree, leaf, and node helped get me get more solid footing.

Official RFC definitions:

rfc1034, section 3.1 defines domain name space, tree, node, label, root, domain name, domain and subdomain [emphasis below mine]:

The domain name space is a tree structure. Each node and leaf on the tree corresponds to a resource set (which may be empty). The domain system makes no distinctions between the uses of the interior nodes and leaves, and this memo [RFC] uses the term "node" to refer to both.

Each node has a label, which is zero to 63 octets in length. Brother nodes [sibblings] may not have the same label [in other words they need to be unique], although the same label can be used for nodes which are not brothers. One label is reserved, and that is the null (i.e., zero length) label used for the root.

[THIS IS IMPORTANT>] The domain name of a node is the list of the labels on the path from the node to the root of the tree.

...

When a user needs to type a domain name, the length of each label is omitted and the labels are separated by dots ("."). Since a complete domain name ends with the root label, this leads to a printed form which ends in a dot. We use this property to distinguish between:

  • a character string which represents a complete domain name (often called "absolute"). For example, "poneria.ISI.EDU." [<-- note the trailing dot]

  • a character string that represents the starting labels of a domain name which is incomplete, and should be completed by local software using knowledge of the local domain (often called "relative"). For example, "poneria" used in the ISI.EDU domain.

Relative names are either taken relative to a well known origin, or to a list of domains used as a search list. Relative names appear mostly at the user interface, where their interpretation varies from implementation to implementation, and in master files, where they are relative to a single origin domain name.

...

[THIS IS ALSO IMPORTANT>] A domain is identified by a domain name, and consists of that part of the domain name space that is at or below the domain name which specifies the domain. A domain is a subdomain of another domain if it is contained within that domain. This relationship can be tested by seeing if the subdomain's name ends with the containing domain's name. For example, A.B.C.D is a subdomain of B.C.D, C.D, D, and " ".


Finally, Wikipedia says:

A hostname is a domain name which has an associated DNS record. When the domain name is looked up (resolved) the resolver returns the IP address of the physical machine which is suppose to respond to requests to that domain. Like for example, there might be a type A DNS record for a given domain name, which returns "a [physical] host address", i.e. an IP address. A web server running on a machine hooked to the internet on that static IP address might then serve web pages when that domain name is used in a URL.

And..

"Hosts that have multiple Internet addresses will have multiple A records." So one physical computer can serve, for example, web pages for one or more domains.

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.