# DNS relay

## 1. Function Overview

The DNS relay function relays DNS packets to the specified DNS server.
The DNS relay function of this product has a cache, so it can answer repeated queries directly without relaying them through a higher-level server.

## 2. Definition of Terms Used

None

## 3. Function Details

The operating specifications for the DNS relay function are outlined below:

1. The DNS relay function of this product can be enabled or disabled for the entire system, as well as for each interface.
   To enable the DNS relay function on an interface, the system-wide setting must be enabled.

   - To configure system-wide settings, use the dns-forwarding command in global configuration mode.

   - To configure each interface, use the dns-forwarding command in the corresponding interface mode.

2. The default settings for the DNS relay function are as follows (it does not function in the initial state):

   - System-wide settings: Disabled

   - Interface settings: Disabled

3. When configuring the DNS relay function settings for an interface, do so for the VLAN interface.

   - The VLAN interface must have an IPv4 address configured.

   - Configure the settings using the dns-forwarding command.

   - This is disabled by default.

   - DNS packets received on an enabled VLAN interface are forwarded to the address specified in the dns-forwarding name-server command.

   - DNS packets using IPv6 are not forwarded.

4. The DNS server to forward to is specified with the dns-forwarding name-server command.

   - If you set a domain name, queries for that domain name will be forwarded only to the configured server.

   - You cannot specify an IPv6 address as the forwarding destination.

   - You can set up to eight items.

5. Once a DNS packet has been forwarded, it is cached.

   - DNS packets remaining in the cache are not forwarded to the server but are answered with the contents of the cache entry.

   - The TTL notified by the destination server is used for the TTL of the cache entry.

   - The maximum TTL value for cache entries can be set with the dns-forwarding cache max-ttl command.

     - If the TTL notified by the destination server exceeds the value set by this command, the value set by this command will be used as the TTL for the cache entry.

   - For A records, a minimum of 500 entries can be registered in the cache.

   - The show dns-forwarding cache command displays the cache.

     - *Up to 1,000 entries will be displayed in the cache. *

6. Static records can be set.

   - Use the dns-forwarding static-host command.

   - You can associate a host name with an IPv4 address.

   - When a query is made for the hostname or address configured with the dns-forwarding static-host command, packets are not forwarded to the server; instead, a response is returned using the settings specified by this command.

   - You can set up to 16 items.

## 4. Related Commands

Related commands are indicated below.
For details on the commands, refer to the Command Reference.

Operations | Operating commands
--- | ---
DNS relay function settings (system) | dns-forwarding
DNS relay function settings (interface) | dns-forwarding
Setting the forwarding address for the DNS relay function | dns-forwarding name-server
Maximum TTL setting for DNS relay cache entries | dns-forwarding cache max-ttl
Deleting DNS relay cache entries | clear dns-forwarding cache
Configuring static records for the DNS relay function | dns-forwarding static-host
Displaying DNS relay status | show dns-forwarding
Displaying DNS relay cache | show dns-forwarding cache

## 5. Examples of Command Execution

### 5.1. DNS Relay Settings

Enable the DNS relay function on vlan1.
DNS packets received from a DNS client on vlan1 are forwarded to a DNS server on the vlan2 network.
The IP address of vlan1 is "192.168.100.240/24", the IP address of vlan2 is "192.168.200.240/24", and the IP address of the DNS server is "192.168.200.1".
Assign vlan2 to port1.2.

■ Setting Procedure

1. Set the forwarding address for the DNS relay function to "192.168.200.1".

       Yamaha(config)# dns-forwarding name-server 192.168.200.1

2. Set the IP address of vlan1 to "192.168.100.240/24".

       Yamaha(config)# interface vlan1
       Yamaha(config-if)# ip address 192.168.100.240/24

3. Create vlan2.

       Yamaha(config)#vlan database
       Yamaha(config-vlan)#vlan 2

4. Set the IP address of vlan2 to "192.168.200.240/24".

       Yamaha(config)# interface vlan2
       Yamaha(config-if)# ip address 192.168.200.240/24

5. Set port1.2 as an access port and assign it to vlan2.

       Yamaha(config)# interface port1.2
       Yamaha(config-if)# switchport access vlan 2

6. Enable DNS relay on vlan1.

       Yamaha(config)# interface vlan1
       Yamaha(config-if)# dns-forwarding enable

7. Activate the DNS relay function for the entire system.

       Yamaha(config-if)# exit
       Yamaha(config)# dns-forwarding enable

## 6. Points of Caution

- For requests to a DNS server that repeatedly fails to resolve DNS names due to network disconnections or other reason, an error will be returned without querying the DNS server.

  - Transfers will begin once the connection is established, but it may take some time before the transfer begins.

  - If no domain name is specified, DNS requests for all domains will be directed to the specified server, which may result in repeated name resolution failures on the local network.

    - To resolve names for a local domain maintained on an internal server, specify the server for the domain name as follows:

          dns-forwarding name-server 192.168.100.1 example.com

## 7. Related Documentation

None

Search result
No more search results.
There are no topics that match your search query.