The Domain Name System (DNS) translates domain and host names to and from IP addresses. A DNS client resolves hostnames to IP addresses by querying assigned DNS servers for the appropriate IP address.
(switch(config)#) Configure the switch to resolve queries via a DNS server.
ip name-server <IPv4/IPv6 address>
(switch(config)#) Configure a domain name.
ip domain-list mydomain2.com
show hosts