What are the parts of a URL?
Country-code top-level domain (ccTLD)
A top-level domain defined in the ISO 3166-1 Country Codes list.
For https://example.org.au, the ccTLD is au. For https://example.io, the ccTLD is io.
Domain name
The parts of an HTTP or HTTPS URL separated by dots: everything after the scheme, but before the path or port (if specified). Each part of the domain name is known as a label.
URL Domain name https://example.github.io/path example.github.io https://support.example.org.au:443 support.example.org.au
Fully-qualified domain name (FQDN)
A complete address for a website or a server, that maps to an IP address.
URL FQDN https://example.com:1234/cats example.com https://api.example.github.io api.example.github.io
Host
As defined in the URL standard, a host can be a domain name, IP v4 address, IPv6 address, opaque host, or empty host.
The URL standard’s definition of host does not include the port. URL.host includes the port, unless the port is the default for the scheme. URL.hostname does not include the port.
URL URL.host https://www.example.com:443/cat www.example.com // 443 is the default port for the scheme https://www.example.com:1234/cat www.example.com:1234 https://cat.example.github.io cat.example.github.io
Hostname
Hostname is defined by the JavaScript URL API, but not elsewhere by the URL standard. See host representation for more detail. URL.hostname returns the host without the port.
URL URL.hostname https://www.example.com:443/cat www.example.com https://www.example.com:1234/cat www.example.com https://cat.example.github.io cat.example.github.io
Origin
For HTTP or HTTPS URLs, URL.origin returns the scheme, the host, and port (unless the port is the default for the scheme).
URL URL.origin https://www.example.com:443/cat https://www.example.com https://www.example.com:1234/cat https://www.example.com:1234 https://cat.example.github.io https://cat.example.github.io
Scheme
The part of the URL (before ://) that defines the network protocol (or action to be taken by the user agent) when a request is made to a URL. For example, a request to a URL with an https scheme should be made using the HTTPS protocol. For a request to a URL with a scheme such as file, mailto or git that doesn’t correspond to a network protocol, behavior depends on the user agent. For example, when a user clicks on a mailto link, most browsers open their default email application, using the values in the link’s href URL.