DNS configuration examples
This section presents the following topics:
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.
Step | Command |
---|---|
Specify the IP address of the DNS server. |
|
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:
Setting up 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.
Step | Command |
---|---|
Set the service provider. |
|
Set the DDNS service provider login ID (for example, vtest). |
|
Set the DDNS service provider password (for example, testpwd). |
|
Specify R1 as a host name whose DNS entry needs to be updated when the IP address on dp0p1p1 changes. |
|
Specify www as a host name whose DNS entry needs to be updated when the IP address on dp0p1p1 changes. |
|
Commit the changes. |
|
Show the dynamic DNS configuration. |
|
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.
Configuring DNS forwarding
Configuring the vRouter for DNS forwarding has two main steps:
- Specifying the DNS name servers to which to forward
- Specifying the interfaces on which to listen for DNS requests
Specifying DNS Name Servers
Name server locations can be obtained in three ways:
- From the system name server list, defined by using the set system name-server command
- By DHCP
- By listing additional name servers by using service dns forwarding dhcp <interface>
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:
- Specifically use system-defined name servers. To do this, use service dns forwarding system.
- Specifically use name servers received for the interface that is using DHCP client to get an IP. To do this, use service dns forwarding dhcp <interface>.
- List additional name servers by using service dns forwarding name-server <ipv4>.
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.
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.
Step | Command |
---|---|
Set IP address and prefix on dp0p1p2. |
|
Set dp0p1p1 as a DHCP client. |
|
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. |
|
Specify the default router for dp0p1p2_POOL. |
|
Create a DNS server list using DNS server information provided by the DHCP server of the ISP (on dp0p1p1). |
|
Listen for DNS requests on dp0p1p2. |
|
Specify a DNS server for dp0p1p2_POOL (in this case, it acts as a DNS forwarder). |
|
Commit the changes. |
|
Show the DNS-related configuration. |
|
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.
Step | Command |
---|---|
Create the static host-mapping configuration node. |
|
Provide an alias host name (this step is optional). |
|
Specify the IP address to be returned in response to the DNS query. |
|
Commit the changes. |
|
Show the static host-mapping configuration. |
|