Example for Configuring DNS Proxy
Networking Requirements
As shown in Figure 4-8, the enterprise does not deploy a DNS server. The route between the RouterA and the DNS server or between the RouterA and the FTP server is reachable. The mapping between the domain name (huawei.com) of the FTP server and the IP address 10.2.1.3 is recorded on the DNS server. Enterprise users expect to access the FTP server through the DNS domain name. To facilitate maintenance, the enterprise users are unaware of the DNS server address change.
Configuration Roadmap
The configuration roadmap is as follows:
Configure DNS proxy on RouterA to implement domain name resolution for clients.
After DNS Proxy is enabled, the RouterA can be regarded as the DNS server of HostA. You need to configure the RouterA's IP address as the IP address of the DNS server on HostA, and configure the IP address (10.2.1.1) of the DNS server on the Internet network on the RouterA. In this way, when the DNS server address changes, you only need to modify the configurations on the RouterA, which is not detected by the users.
Procedure
- Configure an IP address for GE1/0/0.
<Huawei> system-view [Huawei] sysname RouterA [RouterA] interface gigabitethernet 1/0/0 [RouterA-GigabitEthernet1/0/0] ip address 10.1.1.1 255.255.0.0 [RouterA-GigabitEthernet1/0/0] quit
- Configure DNS Proxy.
[RouterA] dns proxy enable [RouterA] dns resolve [RouterA] dns server 10.2.1.1
- Configure the default route from the DNS proxy to the DNS server.
Assume that the IP address of the next hop from the DNS proxy to the DNS server is 10.1.1.2/16.
[RouterA] ip route-static 0.0.0.0 0.0.0.0 10.1.1.2 [RouterA] quit
- Specify the IP address of the DNS server on HostA as 10.1.1.1.
- Verify the configuration.
# Run the display current-configuration command to view the DNS proxy configuration on RouterA.
<RouterA> display current-configuration | include dns dns resolve dns server 10.2.1.1 dns proxy enable
# Run the ping huawei.com command on LAN HostA. You can see that the ping operation succeeds
C:\Documents and Settings\HostA>ping huawei.com PING huawei.com [10.2.1.3] with 32 bytes of data: Reply from 10.2.1.3: bytes=32 time=16ms TTL=255 Reply from 10.2.1.3: bytes=32 time<1ms TTL=255 Reply from 10.2.1.3: bytes=32 time<1ms TTL=255 Reply from 10.2.1.3: bytes=32 time<1ms TTL=255 Ping statistics for 10.2.1.3: Packets: Sent = 4, Received = 4, Lost = 0(0% loss), Approximate round trip times in milli-seconds: Minimum = 0ms, Maximum = 16ms, Average = 4ms