6.1 Managing the Switch Name
These sections describe how to configure the switch’s domain and host name.
Section 6.1.1: Assigning a Name to the Switch describes the assigning of an FQDN to the switch.
Section 6.1.2: Specifying DNS Addresses describes the adding of name servers to the configuration.
6.1.1 Assigning a Name to the Switch
A fully qualified domain name (FQDN) labels the switch and defines its organization ID in the Domain Name System hierarchy. The switch’s FQDN consists of a host name and domain name.
The host name is uniquely associated with one device within an IP-domain. The default host name is localhost. You can configure the prompt to display the host name, as described in Section 6.4.2: Prompt.
To assign a host name to the switch, use the hostname command. To return the switch’s host name to the default value of localhost, use the no hostname command.
To specify the domain location of the switch, use the dns domain command.
Example
This command assigns the string main-host as the switch’s host name.
switch(config)#hostname main-host
main-host(config)#
This command configures aristanetworks.com as the switch’s domain name.
switch(config)#dns domain aristanetworks.com
switch(config)#
This procedure configures sales1.samplecorp.org as the switch’s FQDN.
switch(config)#dns domain samplecorp.org
switch(config)#
This running-config extract contains the switch’s host name and IP-domain name.
switch#show running-config
! Command: show running-config
! device: switch (DCS-7150S-64-CL, EOS-4.13.2F)
!
<-------OUTPUT OMITTED FROM EXAMPLE--------> 
vlan 3-4
!
username john secret 5 $1$a7Hjept9$TIKRX6ytkg8o.ENja.na50
!
hostname sales1
ip name-server vrf default 172.17.0.22
dns domain samplecorp.org
!
<-------OUTPUT OMITTED FROM EXAMPLE--------> 
end
switch#
6.1.2 Specifying DNS Addresses
The Domain Name Server (DNS) maps FQDN labels to IP addresses and provides addresses for network devices. Each network requires at least one server to resolve addresses. The configuration file can list a maximum of three server addresses.
To add name servers to the configuration, use the ip name-server command. Each command can add one to three servers. The switch disregards any attempt to add a fourth server to the configuration. All server addresses must be in a single VRF. If servers have been previously configured in a different VRF they must be removed before adding a new server to the configuration.
Example
This code performs these actions:
adds three names servers to the configuration in the default VRF
attempts to add a fourth server, resulting in an error message
displays the configuration file.
 
switch(config)#ip name-server 10.1.1.24 10.1.1.25 172.17.0.22
switch(config)#ip name-server 10.15.3.28
% Maximum number of nameservers reached. '10.15.3.28' not added
switch(config)#show running-config
! device: Switch (EOS-4.11.2-1056939.EOS4112)
!
username david secret 5 $1$a7Hjept9$TIKRX6ytkg8o.ENja.na50
!
hostname Switch
ip name-server 10.1.1.24
ip name-server 10.1.1.25
ip name-server 172.17.0.22
dns domain aristanetworks.com
<-------OUTPUT OMITTED FROM EXAMPLE--------> 
The switch assigns source IP addresses to outgoing DNS requests. To force the switch to use a single, user-defined source interface for all requests, use the ip domain lookup command.
Example
This command forces the switch to use VLAN 5 as the source interface for DNS requests originating from the default VRF.
switch(config)#ip domain lookup source-interface Vlan5
switch(config)#
This command forces the switch to use VLAN 10 as the source interface for DNS requests originating from VRF “purple.”
switch(config)#ip domain lookup vrf purple source-interface Vlan10
switch(config)#