DNS Configuration
The Domain Name System (DNS) enables switches to resolve hostnames to IP addresses, simplifying network management and configuration.
Supermicro Enterprise Advanced SONiC supports DNS client functionality, allowing administrators to reference servers and services by name rather than IP address for operations such as NTP synchronization, syslog forwarding, and remote authentication.
-
Configure the source interface on the switch that is used for the source IP address in DNS queries.
Leaf1(config)# ip name-server source-interface {Eth slot/port[/breakout-port] | Loopback number | Management0 | PortChannel number | Vlan vlan-id}
-
Configure a DNS server. Enter an IPv4 address in A.B.C.D format. Enter an IPv6 address in A::B format. Enter a VRF name to specify the VRF to use for reaching the name server.
Leaf1(config)# ip name-server {ip-address | ipv6-address} [vrf vrf-name]
-
To configure additional DNS servers, reenter the
ip name-servercommand. -
Verify the DNS server configuration.
Leaf1# show hosts
A sample DNS server configuration appears as follows:
Leaf1(config)# ip name-server source-interface Loopback0
Leaf1(config)# ip name-server 1.2.3.4 vrf mgmt
Leaf1(config)# ip name-server 2001:4860:4860::8888 vrf mgmt
Leaf1(config)# ip name-server 8.8.8.8
Leaf1# show hosts
Source Interface: Loopback0
Name servers are: 1.2.3.4(vrf: mgmt), 2001:4860:4860::8888(vrf: mgmt), 8.8.8.8