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.
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.
To configure a Domain Name Server (DNS) on Juniper SRX devices by using J-Web, perform the following:
Select Configuration > System Properties > System Identity.
Click Edit. The Edit System Identity window appears.
In the Hostname box, enter the name of the device (for example, myserver).
In the Domain name box, enter the domain name for the device (for example, example.com).
In the DNS servers area, click Add to add a DNS server. The Add DNS Server window appears.
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.
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.
If you have finished configuring the device, click Commit to commit the configuration.
To configure DNS on the SRX device by using the Command Line Interface, perform the following:
Specify the name of the device as myserver by using the set system host-name command.
user@host# set system host-name myserver
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
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
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 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;
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.
Use the show monitor traffic operational command to troubleshoot any issues between the SRX 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 [juniper.net].
For high-end devices, see KB21563 - [SRX] Example - Creating a PCAP packet capture on high-end SRX devices [juniper.net].
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
[SRX] Configuration example using fully qualified domain names in security policies