Explore WaseerHost

Appearance

BlogDomainsDomain Names 11 min read

What Is a Fully Qualified Domain Name (FQDN)?

An FQDN is a host's complete DNS name, up to the root. The trailing dot, FQDN vs hostname vs URL, length limits, and how to find your computer's FQDN.

Waqas Ahmed Waseer, authorWaqas Ahmed WaseerFounder & CEO
Updated
What Is a Fully Qualified Domain Name (FQDN)?

Summarize with:

Share:

A fully qualified domain name (FQDN) is the complete name of one specific host in the Domain Name System, written with every label from the host up to the root, such as mail.example.com.. Nothing is left for software to fill in, so it points to exactly one place in the DNS tree. In everyday writing the final dot is usually dropped, and mail.example.com is still called fully qualified.

Key takeaways

  • An FQDN names one node in the DNS tree by listing every label up to the root, for example www.example.com..
  • The trailing dot stands for the root. In everyday use you can leave it out, but DNS zone files treat a name without it as relative.
  • An FQDN is not a URL. A URL adds a scheme such as https://, and often a port, path or query, around the host name.
  • Each label can be at most 63 octets, and the whole name at most 255 octets on the wire, which works out to 253 characters of text.
  • You meet FQDNs in SSL certificates, mail server settings, DNS zone files and hosts files. On Linux, hostname -f prints your machine's FQDN; on Windows, ipconfig /all shows the host name and primary DNS suffix that form it.

What is a fully qualified domain name?

DNS names form a tree. The root sits at the top, top-level domains such as com sit under it, and every other name hangs below those. A domain name is the list of labels on the path from a node up to the root (RFC 1034, section 3.1).

A fully qualified domain name is a name that includes all of those labels, with none missing. The IETF's DNS terminology document (RFC 8499, since replaced by RFC 9499) says that, strictly speaking, an FQDN includes every label including the zero-length label of the root, so it is written www.example.net. with a terminating dot. It also notes that names written without that dot, like www.example.net, are still commonly called fully qualified.

The opposite is a relative name, such as mail on its own. RFC 1034 describes relative names as incomplete: local software has to finish them by adding a domain before they can be looked up. An FQDN needs no such help, which is why servers, certificates and configuration files ask for one.

The parts of an FQDN

Take www.shop.example.com. and read it from right to left, because DNS works from the root down:

PartIn the exampleWhat it is
Rootthe final .The empty label at the top of the DNS tree
Top-level domain (TLD)comThe extension, run by a registry
Second-level domainexampleThe name you register at a registrar
SubdomainshopA label the domain owner creates under their domain
Host labelwwwThe leftmost label, usually naming a service or machine

Not every FQDN has all five parts. example.com. is itself a fully qualified name, and if it points to a web server (an A record at the domain's apex), it identifies that host just as www.example.com. does.

The trailing dot and the root

On the wire, DNS stores a name as a series of labels, each preceded by a one-octet length. Every name ends with the null label of the root, so the encoded name finishes with a zero-length byte (RFC 1035, section 3.1). In text, that empty root label is the trailing dot.

You rarely have to type it. Where it matters most is a DNS zone file. RFC 1035 (section 5.1) says names that end in a dot are absolute and taken as complete, while names without the dot are relative and get the zone's origin (set with $ORIGIN) appended. That rule causes a classic mistake:

dns
$ORIGIN example.com.
www     IN  CNAME  web.example.com.    ; absolute: points to web.example.com
blog    IN  CNAME  web.example.com     ; relative: becomes web.example.com.example.com.

The second record is missing its final dot, so the server reads it as web.example.com.example.com., which almost certainly doesn't exist. If you edit raw zone files, check every name on the right-hand side for its final dot.

FQDN vs hostname vs domain name vs URL

These terms overlap, and people use them loosely. Here is how they differ in practice:

TermExampleWhat it means
Hostnamemail or mail.example.comA name for a machine or service. RFC 9499 notes the term has no single formal definition; it often means the leftmost label, or any name made of letters, digits and hyphens
Domain nameexample.comThe name of a node in the DNS tree. You register one and create names under it
FQDNmail.example.com.A domain name with every label up to the root, so it identifies one exact node
URLhttps://mail.example.com:443/inbox?id=7A full address for a resource: a scheme, then an authority (host and optional port), then path, query and fragment (RFC 3986)

The quickest test is to look for a scheme or a path. If it starts with https:// or contains a / path, it's a URL. Strip the scheme, port and path, and the host part left over is usually an FQDN.

How long can an FQDN be?

DNS sets two limits, both in octets (bytes):

LimitValueSource
One label63 octets or lessRFC 1035, section 2.3.4; RFC 1034, section 3.1
Whole name255 octets or less, in wire formatRFC 1035, section 2.3.4; RFC 9499
Name as typed text253 characters, without the trailing dotFollows from the 255-octet wire limit

Why 253? In wire format every label carries one extra length octet, and the name ends with a zero octet for the root. A name typed as n characters (dots included, no trailing dot) therefore takes n + 2 octets on the wire. With a 255-octet ceiling, the longest name you can type is 253 characters.

For host names, RFC 1034 (section 3.5) recommends labels that start with a letter, end with a letter or digit, and contain only letters, digits and hyphens. RFC 1123, section 2.1 later relaxed the first character to allow a digit, and says host software must handle host names up to 63 characters and should handle names up to 255.

Where you meet FQDNs

SSL/TLS certificates

Public certificates name the hosts they cover as FQDNs. The CA/Browser Forum Baseline Requirements, the rules public certificate authorities follow, define an FQDN as a domain name that includes the labels of all superior nodes in the DNS, and list FQDNs in the certificate's subjectAltName field. A wildcard name is *. followed by an FQDN, such as *.example.com (CA/Browser Forum). That's why a certificate for example.com doesn't automatically cover shop.example.com: they are different FQDNs. Every WaseerHost hosting plan includes free SSL certificates; see current shared hosting plans.

Email servers

SMTP is strict about names. RFC 5321 (section 2.3.5) says only resolvable, fully qualified domain names are permitted when domain names are used in SMTP, and a sending server's EHLO greeting contains its FQDN if it has one (section 4.1.1.1). A mail server that announces itself as plain server1 breaks that rule. If you are setting up mail for your domain, see WaseerHost business email.

DNS zone files

Every record in a zone has an owner name and often a target name, and both resolve to FQDNs, either written out with a trailing dot or completed with $ORIGIN as shown above. Nameserver records are a good example; what nameservers are and how to change them walks through them.

Hosts files

The hosts file maps names to IP addresses without asking DNS. On Linux the format is IP_address canonical_hostname [aliases...], and the manual's own examples put the FQDN first and the short name as an alias (hosts(5)):

text
127.0.1.1       thishost.example.org   thishost
192.168.1.10    foo.example.org        foo

How to find your computer's FQDN

Windows

Windows builds the computer's FQDN from its host name plus its primary DNS suffix. Microsoft describes the primary DNS suffix as the suffix appended to the computer's name to complete its fully qualified domain name, and says you can view it with ipconfig /all (Microsoft Learn).

  1. Open Command Prompt or PowerShell.
  2. Run:
powershell
ipconfig /all
  1. Near the top, under Windows IP Configuration, read Host Name and Primary Dns Suffix.
  2. Join them with a dot. A host name of PC-042 and a suffix of corp.example.com give the FQDN PC-042.corp.example.com.

If Primary Dns Suffix is blank, Windows has no suffix to add, so the host name is all there is. On a computer joined to Active Directory, the suffix is by default the name of the domain it joined (Microsoft Learn).

macOS

  1. Choose Apple menu > System Settings, then click General in the sidebar.
  2. Click Sharing.
  3. Read the Local hostname at the bottom of the window (Apple Support).

Apple explains that the local hostname is your computer's name with .local added and spaces replaced by hyphens, so "My Computer" becomes My-Computer.local. Keep in mind that .local names are special. RFC 6762 reserves .local. for Multicast DNS, and such names only mean something on the local network link. So My-Computer.local works for file sharing at home but is not a name anyone on the internet can look up.

If your provider supports secure dynamic DNS updates, the same Local hostname > Edit dialog has a Use dynamic global hostname option that gives your Mac a global DNS name (Apple Support).

Linux

Use the hostname command from net-tools (hostname(1)):

bash
hostname -f   # the FQDN (also --fqdn or --long)
hostname -s   # the short name, cut at the first dot
hostname -d   # the DNS domain: the FQDN minus the first label

Example output on a server called web1 in example.com:

text
web1.example.com
web1
example.com

The manual explains that hostname can't set the FQDN directly. It reports the canonical name the resolver returns for the machine's host name, so if your system checks the hosts file first, you change the FQDN by editing /etc/hosts.

Check that an FQDN resolves

Knowing a name is fully qualified doesn't mean it exists in DNS. To check that it has a record, query it with dig on macOS or Linux (see the BIND 9 dig manual):

bash
dig mail.example.com A +short
dig www.example.com CNAME +short

An empty answer means there is no record of that type. You can run the same check from a browser with the WaseerHost DNS lookup tool. If a record you just changed still returns the old value on your computer, flushing your DNS cache usually clears it.

Creating your own names starts with registering a domain. You can search for one on the WaseerHost domains page.

Frequently asked questions

www.example.com. is a fully qualified domain name. Here www is the host label, example the second-level domain, com the top-level domain, and the final dot the root. Written without the dot, www.example.com is still called fully qualified in everyday use. mail.example.com and shop.example.co.uk are other examples.

Waqas Ahmed Waseer

Written by

Waqas Ahmed Waseer

Founder & CEO

Founder and CEO of Wasevo LLC, the company that runs WaseerHost. He works on cPanel/WHM servers, WHMCS billing and the Next.js storefront.

Related Articles

Get new guides by email

One short email when we publish something useful. No spam; unsubscribe at any time.

Free SSL · Free migration · 24/7 support

Find your domain

Search domains
30-day money-back guarantee

Renews at the same price for the term you choose