Description

This article describes how to configure a Domain Name Server (DNS) on SRX-Series devices, verify that the configuration works correctly, and troubleshoot any DNS related issues that you may encounter. 

For other related topics, go to the KB15694 - SRX Getting Started - Configuration Examples & Troubleshooting (JumpStation) [juniper.net] main page.

Symptoms

To configure a Domain Name Server (DNS) on SRX-Series devices, performing the following tasks:

  • Configure the device hostname.

  • Configure DNS servers.

  • Configure the domain name.

Solution

J-Web Configuration

To configure a Domain Name Server (DNS) on Juniper SRX devices by using J-Web, perform the following:

  1. Select Configuration > System Properties > System Identity.

  2. Click Edit. The Edit System Identity window appears.

  3. In the Hostname box, enter the name of the device (for example, myserver).

  4. In the Domain name box, enter the domain name for the device (for example, example.com).

  5. In the DNS servers area, click Add to add a DNS server. The Add DNS Server window appears.

  6. In the IP address box, enter the IP address of a DNS server, and click OK.

To add multiple DNS servers, repeat steps 5 and 6 for each server.

  1. In the Edit System Identity window, click OK. A status popup window appears. If the configuration changes are validated successfully, the popup window automatically closes. If the changes are not validated, click Details for more information.

  2. If you have finished configuring the device, click Commit to commit the configuration.

CLI Configuration 

To configure DNS on the SRX device by using the Command Line Interface, perform the following:

  1. Specify the name of the device as myserver by using the set system host-name command.

user@host# set system host-name myserver
  1. To configure DNS servers to resolve hostnames, use the set system name-server command. In the following example, two public DNS servers (208.67.222.222 and 208.67.220.220) from OpenDNS.com are configured.

user@host# set system name-server 208.67.222.222
user@host# set system name-server 208.67.220.220
  1. Configure the domain name of example.com for the device by using the set system domain-name command.

user@host# set system domain-name example.com

Technical Documentation

See the section "Understanding DNS" in Getting Started Guide for Routing Devices.

Verification

To verify the hostname of the device, use the show system host-name command.

user@host#  show system host-name  
host-name myserver;

To verify the domain name server configuration, use the show system name-server command.

user@host#    show system name-server   
208.67.222.222;
208.67.220.220;

To verify the domain name for the device, use the show system domain-name command.

user@host#  show system domain-name  
domain-name example.com;

Troubleshooting

NOTE: Name resolution will not work for SRX devices if the DNS server is only reachable via a VR (Virtual Router). The SRX device cannot source the DNS queries from a VR type routing instance.

Modification History

2026-02-16: Minor, non-technical modifications made for search optimization

2020-06-29: Article reviewed for accuracy; troubleshooting links for high end, branch end and virtual SRX updated

Related Information