| Description | This article describes the use of DNS-server-override when the internet link is dynamic (PPPoE or DHCP). |
| Scope | FortiGate v6.4. v7.0. v7.2 and v7.4. |
| Solution |
When the FortiGate internet is assigned an IP address from PPPoE or DHCP, it will get a DNS IP from it. FortiGate will use the acquired DNS IP for the ISP, as well as the configured DNS server IP in the DNS settings.
To use the configured DNS server, disable the 'Override internal DNS' at Network -> Interfaces and select the respective interface.
Once disabled, going back to Network -> DNS, the entry under Dynamically Obtained DNS servers should be gone.
This does not mean that FortiGate DNS will not be used. There are cases when acquired DNS from ISPs is not reachable or when system DNS has lower latency; in this case, both acquired and system DNS will be used.
One example of implementing this feature is when using VDOMs and using specific DNS servers for a particular VDOM, and not using global settings, but per-VDOM DNS.
From CLI:
Note: A DHCP address issued by a cloud platform like Azure for a FortiGate VM instance hosted in it includes Azure DNS IP addresses as well (in the DHCP option 6). This DNS IP(s) will be listed on top of the DNS list as shown in the below CLI command. If the locally configured DNS server IP addresses (in the FortiGate configuration) are required to be on top of this DNS list instead, use the 'dns-server-override disable' option.
In the example output above, the first two are Azure DNS IP addresses, and the last two are the locally configured DNS IP addresses in FortiGate under 'config system dns' and 'set primary <IP> / set secondary <IP>'. To ensure the local DNS IP addresses are on top of the list, use the 'set dns-server-override disable' option under the corresponding interface 'config system interface' that is receiving the DHCP address.
Related documents: |
The Fortinet Security Fabric brings together the concepts of convergence and consolidation to provide comprehensive cybersecurity protection for all users, devices, and applications and across all network edges.
Copyright 2025 Fortinet, Inc. All Rights Reserved.