Setting Up DNS
If you use the device IP address as its hostname, the IP address is used and no DNS query occurs. If you
configure a hostname that contains no periods (.), a period followed by the default domain name is appended
to the hostname before the DNS query is made to map the name to an IP address. The default domain name
is the value set by the
ip domain-name
global configuration command. If there is a period (.) in the hostname,
the Cisco IOS software looks up the IP address without appending any default domain name to the hostname.
Follow these steps to set up your switch to use the DNS:
SUMMARY STEPS
1.
enable
2.
configure terminal
3.
ip domain-name name
4.
ip name-server server-address1
[
server-address2 ... server-address6
]
5.
ip domain-lookup
[
nsap
|
source-interface interface
]
6.
end
7.
show running-config
8.
copy running-config startup-config
DETAILED STEPS
Purpose
Command or Action
Enables privileged EXEC mode. Enter your password if
prompted.
enable
Example:
Step 1
Device>
enable
Enters the global configuration mode.
configure terminal
Example:
Step 2
Device#
configure terminal
Defines a default domain name that the software uses to
complete unqualified hostnames (names without a
dotted-decimal domain name).
ip domain-name name
Example:
Device(config)#
ip domain-name Cisco.com
Step 3
Do not include the initial period that separates an
unqualified name from the domain name.
At boot time, no domain name is configured; however, if
the device configuration comes from a BOOTP or Dynamic
Host Configuration Protocol (DHCP) server, then the default
domain name might be set by the BOOTP or DHCP server
(if the servers were configured with this information).
Specifies the address of one or more name servers to use
for name and address resolution.
ip name-server server-address1
[
server-address2 ...
server-address6
]
Step 4
System Management Configuration Guide, Cisco IOS XE Gibraltar 16.10.x (Catalyst 9200 Switches)
26
Administering the Device
Setting Up DNS