< Home

dns server source-interface

Function

The dns server source-interface command configures the IP address of a specified interface as the source IP address of the DNS query messages sent by a device to the DNS server.

The undo dns server source-interface command restores the default setting.

By default, the source interface IP address is used as the source IP address of the DNS query messages sent by a device to the DNS server.

Format

dns server source-interface interface-type interface-number

undo dns server source-interface

Parameters

Parameter

Description

Value

interface-type interface-number

Specifies the type and number of an interface.

Views

System view

Default Level

2: Configuration level

Usage Guidelines

When a device sends DNS query messages to the DNS server through interface A, the IP address of interface A is used as the source IP address of the DNS query messages by default. If the DNS server only has routes destined for the IP address of interface B and does not have routes destined for the IP address of interface A, you need to set the source IP address of the DNS query messages to the IP address of interface B; otherwise, the DNS server may fail to return response packets due to a route query failure.

This function is supported only if the device performs a DNS query through the DNS server with an IPv4 address and is not supported if the device performs a DNS query through the DNS server with an IPv6 address.

Example

# Configure the IP address of GigabitEthernet 0/0/1 as the source IP address of the DNS query messages sent by a device to the DNS server.

<sysname> system-view
[sysname] dns server source-interface GigabitEthernet 0/0/1
Copyright © Huawei Technologies Co., Ltd.
Copyright © Huawei Technologies Co., Ltd.
< Previous topic Next topic >