Support Support Downloads Knowledge Base Juniper Support Portal Community

Knowledge Base

Search our Knowledge Base sites to find answers to your questions.

Ask All Knowledge Base Sites All Knowledge Base Sites JunosE Defect (KA)Knowledge BaseSecurity AdvisoriesTechnical BulletinsTechnotes Sign in to display secure content and recently viewed articles

SRX Getting Started - Configure DNS



Article ID: KB15656 KB Last Updated: 29 Jun 2020Version: 12.0

This article describes how to configure, verify, and troubleshoot DNS.

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



Configure DNS by performing the following tasks:

  • Configure the device hostname.

  • Configure DNS servers.

  • Configure the domain name.



This section contains the following:

J-Web Configuration


To configure DNS:

  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,

  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 appears. If the configuration changes are validated successfully, the popup 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:

  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 ( and from are configured.

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

user@host# set system domain-name

Technical Documentation


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



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;

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

user@host# show system domain-name


NOTE: Name resolution will not work for SRX 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.

Use the show monitor traffic operational command to troubleshoot any issues between the SRX Series device and the DNS server. For more information, see Using the monitor traffic command.

For issues with transit DNS traffic, use the packet capture feature to snoop packets traveling through the device within the forwarding plane.

For branch devices and virtual SRX, see KB11709 - [Includes video] How to create a PCAP packet capture on a SRX branch device.

For high-end devices, see KB21563 - [SRX] Example - Creating a PCAP packet capture on high-end SRX devices.


Modification History:

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


Related Links

Comment on this article > Affected Products Browse the Knowledge Base for more articles related to these product categories. Select a category to begin.

Getting Up and Running with Junos

Getting Up and Running with Junos Security Alerts and Vulnerabilities Product Alerts and Software Release Notices Problem Report (PR) Search Tool EOL Notices and Bulletins JTAC User Guide Customer Care User Guide Pathfinder SRX High Availability Configurator SRX VPN Configurator Training Courses and Videos End User Licence Agreement Global Search