home

Supported platforms

Vyatta documentation

Learn how to install, configure, and operate the Vyatta Network Operating System (Vyatta NOS) and Orchestrator, which help drive our virtual networking and physical platforms portfolio.

Show Page Sections

DNS configuration examples

Configuring access to a name server

To be able to translate host names (such as www.brocade.com) to IP addresses (such as 69.59.150.141), the system must be able to access a DNS server.

Configuring access to a DNS server is a function of basic system management, and is described in Ciena Vyatta Network OS Basic System Configuration Guide. For your convenience, the configuration example is repeated here.

Configuring static access to a DNS name server configures a static IP address for the DNS server at address 12.34.56.100. To configure the vRouter in this way, perform the following steps.

Table 1. Configuring static access to a DNS name server
StepCommand
Specify the IP address of the DNS server.

vyatta@R1# set system name-server 12.34.56.100

Configuring dynamic DNS

Dynamic DNS shows a typical DDNS scenario. In this scenario:

  • The vRouter (R1) is connected to an ISP via dp0p1p1.
  • The network domain is company.com.
  • The vRouter host name is r1.company.com.
  • The web server of the company is located behind the vRouter. Its host name is www.company.com.
  • The ISP is providing dynamic IP addresses to its clients through DHCP.
  • The IP address of the dp0p1p1 interface in the vRouter changes over time because of the dynamic assignment by the ISP.
  • The web server of the company is behind a Network Address Translation (NAT) device on the vRouter, so its IP address (as viewed from the Internet) changes when the ISP assigns a new address to the dp0p1p1 interface.
  • Because the web address of the server changes, responses to DNS queries for www.company.com must also change to the new IP address. DDNS resolves this problem.

DDNS allows the vRouter (R1) to update the DNS system with the new IP address information for any local host names (for example, r1.company.com, and www.company.com) whenever the IP address on dp0p1p1 changes. The setup process is as follows:

  1. Sign up for DDNS service from one of the supported service providers:
    • DNS Park: www.dnspark.com
    • DSL Reports: www.dslreports.com
    • DynDNS: www.dyndns.com
    • easyDNS: www.easydns.com
    • namecheap: www.namecheap.com
    • Sitelutions: www.sitelutions.com
    • zoneedit: www.zoneedit.com
    The individual providers offer instructions for sign-up.
    Note: Depending on the service provider, host names may need to include the domain name (for example, www instead of www.company.com).
  2. Configure the vRouter (R1 in the example) with service provider information such as the service name, a login ID, and a password so that the system can determine how to log on and send updates to the DDNS service provider.
  3. Configure the vRouter with the host names that must be updated in the DNS system when the IP address on dp0p1p1 changes.

Setting up Dynamic DNS

Figure 1. Dynamic DNS

The following example shows how to set up DDNS for DDNS service provider DynDNS. It is assumed for this example that you have already signed up with DynDNS). To configure the vRouter in this way, perform the following steps in configuration mode.

Table 2. Setting up dynamic DNS
Step Command
Set the service provider.
vyatta@R1# set service dns dynamic interface dp0p1p1 service dyndns 
Set the DDNS service provider login ID (for example, vtest).
vyatta@R1# set service dns dynamic interface dp0p1p1 service dyndns login vtest 
Set the DDNS service provider password (for example, testpwd).
vyatta@R1# set service dns dynamic interface dp0p1p1 service dyndns password testpwd 
Specify R1 as a host name whose DNS entry needs to be updated when the IP address on dp0p1p1 changes.
vyatta@R1# set service dns dynamic interface dp0p1p1 service dyndns host-name r1.company.com 
Specify www as a host name whose DNS entry needs to be updated when the IP address on dp0p1p1 changes.
vyatta@R1# set service dns dynamic interface dp0p1p1 service dyndns host-name www.company.com 
Commit the changes.
vyatta@R1# commit OK 
Show the dynamic DNS configuration.
vyatta@R1# show service dns dynamic
interface dp0p1p1 {
	service dyndns {
		 host-name r1.company.com
	 	host-name www.company.com
		 login vtest
		 password testpwd
	}
}

At this point, whenever the IP address on dp0p1p1 changes, the vRouter automatically logs onto the DynDNS service by using the vtest login ID and the testpwd password. It sends an update for the r1.company.com and www.company.com host names specifying the new IP address required to reach those hosts on the company.com domain. External users that query DNS for r1.company.com or www.company.com are subsequently answered with the new address from the DNS system.

Note: Dynamic DNS updates are logged. To see the updates, set up logging by using the system syslog global facility facility level level command, where facility is daemon and level is notice. See Ciena Vyatta Network OS Basic System Configuration Guide for details.

Configuring DNS forwarding

Configuring the vRouter for DNS forwarding has two main steps:

  1. Specifying the DNS name servers to which to forward
  2. Specifying the interfaces on which to listen for DNS requests

Specifying DNS Name Servers

Name server locations can be obtained in three ways:

By default, the vRouter forwards DNS requests to name servers on the system name server list plus name servers obtained through DHCP. You can override the default behavior by specifying any or all of the following:

These three options can be used in any combination; however, using any of them eliminates the default DNS forwarding behavior.

When DNS forwarding starts or restarts, it broadcasts a message to all the name servers in the pool and selects the first name server to answer. This name server is used unless it becomes unreachable, in which case the system sends another broadcast message to the remaining name servers in the pool.

Specifying the Listening Interfaces

The listening interfaces are the interfaces to which internal clients forward DNS requests. The DNS forwarding service listens for these requests and forwards them to the name server.

To set the listening interface, use service dns forwarding listen-on <interface>. You can specify more than one interface by issuing this command multiple times.

DNS Forwarding Scenario

After these steps are completed, DNS forwarding is set up. At this point, the vRouter DHCP server can be used to distribute the DNS forwarding interface address to DHCP clients. (For information about setting up a DHCP server on the vRouter, see DHCP .

Scenario using DNS forwarding shows a typical scenario in which DNS forwarding is deployed. In this scenario:

  • The ISP is providing dynamic IP addresses to its customers, including a vRouter (R1) through DHCP.
  • The vRouter (R1) is providing DHCP service to clients on its local network.
  • Local clients send DNS requests to the vRouter.
  • The DNS forwarding service on the vRouter forwards the requests to the the DNS server of the ISP.
Figure 2. Scenario using DNS forwarding

The following example shows how to set up the key parts of the vRouter for the preceding scenario. To configure the vRouter in this way, perform the following steps in configuration mode.

Table 3. Setting up DNS forwarding
StepCommand
Set IP address and prefix on dp0p1p2.
vyatta@R1# set interfaces dataplane dp0p1p2 address 192.168.1.254/24 
Set dp0p1p1 as a DHCP client.
vyatta@R1# set interfaces dataplane dp0p1p1 address dhcp 
Set up the DHCP server on R1 by creating the configuration node for dp0p1p2_POOL on subnet 192.168.1.0/24. Specify the start and stop IP addresses for the pool.
vyatta@R1# set service dhcp-server shared-network-name dp0p1p2_POOL subnet 192.168.1.0/24 start 192.168.1.100 stop 192.168.1.199 
Specify the default router for dp0p1p2_POOL.
vyatta@R1# set service dhcp-server shared-network-name dp0p1p2_POOL subnet 192.168.1.0/24 default-router 192.168.1.254 
Create a DNS server list using DNS server information provided by the DHCP server of the ISP (on dp0p1p1).
vyatta@R1# set service dns forwarding dhcp dp0p1p1 
Listen for DNS requests on dp0p1p2.
vyatta@R1# set service dns forwarding listen-on dp0p1p2 
Specify a DNS server for dp0p1p2_POOL (in this case, it acts as a DNS forwarder).
vyatta@R1# set service dhcp-server shared-network-name dp0p1p2_POOL subnet 192.168.1.0/24 dns-server 192.168.1.254 
Commit the changes.
vyatta@R1# commit 
Show the DNS-related configuration.
vyatta@R1# show service dns
forwarding {
	    dhcp dp0p1p1
    	listen-on dp0p1p2
}

Statically configured entries and DNS forwarding

Because of difficulties interworking with network address translation (NAT) on the corporate gateway, it is sometimes difficult to obtain correct IP addresses for hosts on the corporate network. To work around this problem, you can create static entries on a local vRouter by using the system static-host-mapping command. Any entries configured in this way are compared with incoming DNS queries before the query is passed to DNS forwarding. If a match is found, the corresponding IP address is returned.

The following table shows how to set up the system to return an IP address of 12.34.56.78 if it receives a DNS query for either vyatta.com or vdut1.

Table 4. Setting up static entries
Step Command
Create the static host-mapping configuration node.

vyatta@R1# set system static-host-mapping host-name vyatta.com
Provide an alias host name (this step is optional).

vyatta@R1# set system static-host-mapping host-name vyatta.com alias vdut1
Specify the IP address to be returned in response to the DNS query.

vyatta@R1# set system static-host-mapping host-name vyatta.com inet 12.34.56.78
Commit the changes.

vyatta@R1# commit
Show the static host-mapping configuration.

vyatta@R1# show system static-host-mapping
 host-name vyatta.com{
	   alias vdut1
	   inet 12.34.56.78
 }