BF50 Black Friday · 50% off all plans
from $5/mo · Auto-applied ---:--:-- Claim 50% off →
Skip to content

Search Seonio

Type a keyword, domain, or paste a URL

Start free with $1 to see full results. Powered by Seonio
Web Development

Hostname: What it means in URLs and networks

A hostname is the name of a computer or site on a network, like www.example.com in a URL. See the naming rules and how it differs from a domain.

Monthly searches · hostname
22.2k
Keyword research data
hostname
Hostname: What it means in URLs and networks
Click the image to view it full size

Every computer or service on a network can carry a name, so people can reach it with words instead of an IP address. That name is its hostname. On the web, it's the part of a URL between https:// and the next slash or colon. In https://www.example.com:8443/pricing, the hostname is www.example.com.

In JavaScript, a URL's hostname property gives you exactly that part. Its sibling host adds the port when there is one: www.example.com:8443.

Two meanings of "hostname"

The word is used in two ways, and the DNS standards never formally defined it. RFC 9499

  • The full name, such as www.example.com or mail.example.org. This is the meaning in URLs, browsers, web servers and analytics.
  • Just a machine's own name, the first label, such as printer in printer.admin.example.com. This is the meaning when someone asks for "your computer's hostname".

The full name, with every label up to the top-level domain, is also called a fully qualified domain name (FQDN). Strictly, an FQDN ends with a dot for the DNS root, as in www.example.com., but people usually leave it off.

Hostname, domain and subdomain

A hostname can be the same as your registered domain, or a subdomain of it:

URL Hostname Registered domain Subdomain part
https://example.com/ example.com example.com none
https://www.example.com/ www.example.com example.com www
https://blog.example.co.uk/ blog.example.co.uk example.co.uk blog

The domain name is what you register and renew. Hostnames are the names you create under it, each pointing somewhere through DNS.

Rules for a valid hostname

Hostnames follow the DNS "preferred name syntax", with one later change:

  • Characters. Each label, the part between dots, uses only letters a to z, digits 0 to 9 and hyphens. It can start with a letter or a digit and must end with a letter or a digit. Underscores aren't part of the syntax, so keep them out of names people browse to.
  • Length. Each label can be up to 63 characters. The whole name can be at most 255 octets as DNS stores it, counting a length byte for each label, which leaves 253 characters when you write it out.
  • Case. Hostnames are case-insensitive: Example.COM and example.com are the same host.
  • Other alphabets. Names in other scripts are converted to an ASCII form starting with xn--. A browser turns 你好.com into xn--6qq79v.com.

Why hostnames matter for SEO

To a search engine, https://example.com/ and https://www.example.com/ are two different URLs that may show the same page. Google's advice is to pick one version as your canonical URL and redirect the others to it. Google Search Central Read more under canonical tag.

Hostnames also decide what your tools count:

  • Google Search Console. A Domain property covers every hostname under your domain, www and non-www, on all protocols. A URL-prefix property covers only the exact prefix you enter, such as https://www.example.com/.
  • Google Analytics 4. The Hostname dimension shows which hostname each visit happened on. Filter by it to spot your tracking code firing on a staging copy or on someone else's site.

How to find a computer's hostname

  • Windows. Open Command Prompt and type hostname. It shows the host name part of the computer's full name.
  • Linux. Type hostname in a terminal. Add -f to see the fully qualified name.
  • A website. The hostname is in the address bar, between https:// and the first slash.
Seonio

Put it to work on your own site

Keyword research, traffic, backlinks and clustering in one place. Start with a free $1 to test, no card required.