Host Information

This section describes the system’s host information and how to configure them, it covers the following topics:

  • Host name
  • Domain
  • IP address
  • Default gateway
  • Aliases

Host Name

A hostname is the label (name) assigned to a network device (a host) on a network and is used to distinguish one device from another on specific networks or over the internet.

Set a system host name:

set system host-name <hostname>


Only letters, numbers and hyphens are allowed.

Show host name:

show system host-name

Delete host name:

delete system host-name <hostname>

Example: Set system hostname to ‘RT01’:

set system host-name RT01
show system host-name
  host-name RT01

Domain Name

A domain name is the label (name) assigned to a computer network and is thus unique.

Set the system’s domain:

set system domain-name <domain>


Only letters, numbers, hyphens and periods are allowed.

Show domain:

show system domain-name

Remove domain name:

set system delete domain-name <domain>

Example: Set system domain to

set system domain-name
show system domain-name

Static host mappings

How to assign IPs to interfaces is described in chapter Interface Addresses. This section shows how to statically map a system IP to its host name for local (meaning on this VyOS instance) DNS resolution:

set system static-host-mapping host-name <hostname> inet <IP address>

Show static mapping:

show system static-host-mapping

Example: Create a static mapping between the system’s hostname RT01 and IP address

set system static-host-mapping host-name RT01 inet
show system static-host-mapping
  host-name RT01 {


One or more system aliases (static mappings) can be defined:

set system static-host-mapping host-name <hostname> alias <alias>

Show aliases:

show system static-mapping

Delete alias:

delete system static-host-mapping host-name <hostname> alias <alias>

Example: Set alias router1 for system with hostname RT01:

set system static-host-mapping host-name RT01 alias router1
show system static-host-mapping
  host-name RT01 {
      alias router1

Default Gateway/Route

In the past (VyOS 1.1.8) used a gateway-address configured in the system tree (set system gateway-address <IP address>) this is no longer supported and existing configurations are migrated to the new CLI commands.

It is replaced by inserting a static route into the routing table using:

set protocols static route next-hop <gateway ip>

Delete the default route from the system

delete protocols static route

Show default route:

vyos@vyos$ show ip route
Routing entry for
  Known via "static", distance 1, metric 0, best
  Last update 3d00h23m ago
  *, via eth1