# Host header

The HTTP **`Host`** [request header](https://developer.mozilla.org/en-US/docs/Glossary/request%20header) specifies the host and port number of the server to which the request is being sent.

If no port is included, the default port for the service requested is implied (e.g., `443` for an HTTPS URL, and `80` for an HTTP URL).

A `Host` header field must be sent in all HTTP/1.1 request messages.
A [400 Bad Request](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/400) status code may be sent to any HTTP/1.1 request message that lacks or contains more than one `Host` header field.

<table class="properties">
  <tbody>
    <tr>
      <th scope="row">Header type</th>
      <td>[Request header](https://developer.mozilla.org/en-US/docs/Glossary/Request%20header)</td>
    </tr>
    <tr>
      <th scope="row">[Forbidden request header](https://developer.mozilla.org/en-US/docs/Glossary/Forbidden%20request%20header)</th>
      <td>Yes</td>
    </tr>
  </tbody>
</table>

## Syntax

```http
Host: <host>:<port>
```

## Directives

- `<host>`
  - : The domain name of the server (for virtual hosting).
- `<port>` 
  - : TCP port number on which the server is listening.

## Examples

```http
Host: developer.mozilla.org
```

## Specifications

## Browser compatibility

## See also

- [400](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/400)
- [base](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/base)
