## NameVirtualHost

Syntax: NameVirtualHost addr[:port]
Context: server config
Status: core
Compatibility: NameVirtualHost is only available in Apache 1.3 and later

The NameVirtualHost directive is a required directive if you want to configure name-based virtual hosts.

Although addr can be hostname it is recommended that you always use an IP address, e.g.

> `NameVirtualHost 111.22.33.44`

With the NameVirtualHost directive you specify the address to which your name-based virtual host names resolve. If you have multiple name-based hosts on multiple addresses, repeat the directive for each address.

Note: the "main server" and any _default_ servers will never be served for a request to a NameVirtualHost IP Address (unless for some reason you specify NameVirtualHost but then don't define any VirtualHosts for that address).

Optionally you can specify a port number on which the name-based virtual hosts should be used, e.g.

> `NameVirtualHost 111.22.33.44:8080`

See also: Apache Virtual Host documentation