Managing the Switch Name
- Assigning a Name to the Switch describes assigning an FQDN to the switch.
- Specifying DNS Addresses describes adding name servers to the configuration.
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.
- 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.
Examples
- 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) ! 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 ! end switch#
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 multiple servers. All server addresses support multiple VRFs, and a priority may be specified for each server named. If all name servers have the default priority (0), the default DNSmasq behavior is followed for the configuration. It queries all name servers simultaneously and forwards the requests to the first name server for 50 queries or 20 seconds, whichever expires sooner for answering. If any priorities are non-zero, queries are issued in order with a five second timeout between unresponsive name servers.
Example
switch(config)# show ip name-server
IP Address VRF Priority
---------- ------- --------
10.0.0.1 default 0
10.0.0.2 default 1
10.0.0.1 vrf1 2
10.0.0.2 vrf1 3
fc00::1 default 4
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.
Examples
- 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)#
- This command configures up to four name servers on VRF
purple.
switch(config)# ip name-server vrf purple 10.1.1.24 priority 4 switch(config)#
- This command removes the name
servers.
switch(config)# no ip name-server vrf purple 10.1.1.24 switch(config)#
- This command removes all configured name in all
VRFs.
switch(config)# no ip name-server switch(config)#
NXDOMAIN
is considered a valid reply for the query.