Configuring an SVM and data LIFs for host-name resolution using an external DNS server

You can use the vserver services name-service dns command to enable DNS on an SVM, and configure it to use DNS for host-name resolution. Host names are resolved using external DNS servers.

Before you begin

A site-wide DNS server must be available for host name lookups.

You should configure more than one DNS server to avoid a single-point-of-failure. The vserver services name-service dns create command issues a warning if you enter only one DNS server name.

About this task

The Network Management Guide contains information about configuring dynamic DNS on the SVM.

Procedure

  1. Enable DNS on the SVM: vserver services name-service dns create -vserver vserver_name -domains domain_name -name-servers ip_addresses -state enabled

    The following command enables external DNS server servers on the SVM vs1:

    vserver services name-service dns create -vserver vs1.example.com -domains example.com -name-servers 192.0.2.201,192.0.2.202 -state enabled
    Note: Starting in ONTAP 9.2, the vserver services name-service dns create command performs an automatic configuration validation and reports an error message if ONTAP cannot contact the name server.
  2. Enable DNS on LIFs owned by the SVM:
    If you are: Use this command:
    Modifying an existing LIF network interface modify -lif lifname -dns-zone zone-name
    Creating a new LIF network interface create -lif lifname -dns-zone zone-name
    vserver services name-service dns create -vserver vs1 -domains example.com -name-servers 192.0.2.201, 192.0.2.202 -state enablednetwork interface modify -lif datalif1 -dns-zone zonename.whatever.com
  3. Validate the status of the name servers by using the vserver services name-service dns check command.

    The vserver services name-service dns check command is available starting in ONTAP 9.2.

    vserver services name-service dns check -vserver vs1.example.com
    
    Vserver           Name Server     Status       Status Details
    ----------------  -------------   ----------   --------------------------
    vs1.example.com   10.0.0.50         up         Response time (msec): 2
    vs1.example.com   10.0.0.51         up         Response time (msec): 2