FortiGate DNS server
You can create local DNS servers for your network. Depending on your requirements, you can either manually maintain your entries (primary DNS server), or use it to refer to an outside source (secondary DNS server).
A local, primary DNS server requires that you to manually add all URL and IP address combinations. Using a primary DNS server for local services can minimize inbound and outbound traffic, and access time. Making it authoritative is not recommended, because IP addresses can change, and maintaining the list can become labor intensive.
A secondary DNS server refers to an alternate source to obtain URL and IP address combinations. This is useful when there is a primary DNS server where the entry list is maintained.
In version 6.2 and later, FortiGate as a DNS server also supports TLS connections to a DNS client. See DNS over TLS for details.
By default, DNS server options are not available in the FortiGate GUI.
To enable DNS server options in the GUI:
- Go to System > Feature Visibility.
- Enable DNS Database in the Additional Features section.
- Click Apply.
Example configuration
This section describes how to create an unauthoritative primary DNS server. The interface mode is recursive so that, if the request cannot be fulfilled, the external DNS servers will be queried.
To configure FortiGate as a primary DNS server in the GUI:
- Go to Network > DNS Servers.
- In the DNS Database table, click Create New.
- Set Type to Master.
- Set View to Shadow.
The View setting controls the accessibility of the DNS server. If you select Public, external users can access or use the DNS server. If you select Shadow, only internal users can use it.
- Enter a DNS Zone, for example, WebServer.
- Enter the Domain Name of the zone, for example, fortinet.com.
- Enter the Hostname of the DNS server, for example, Corporate.
- Enter the Contact Email Address for the administrator, for example, admin@example.com.
- Disable Authoritative.
- Add DNS entries:
- In the DNS Entries table, click Create New.
- Select a Type, for example Address (A).
- Set the Hostname, for example web.example.com.
- Configure the remaining settings as needed. The options vary depending on the selected Type.
- Click OK.
- Add more DNS entries as needed.
- Click OK.
- Enable DNS services on an interface:
- Go to Network > DNS Servers.
- In the DNS Service on Interface table, click Create New.
- Select the Interface for the DNS server, such as wan2.
- Set the Mode to Recursive.
- Click OK.
To configure FortiGate as a primary DNS server in the CLI:
config system dns-database edit WebServer set domain example.com set type master set view shadow set ttl 86400 set primary-name corporate set contact admin@example.com set authoritative disable config dns-entry edit 1 set hostname web.example.com set type A set ip 192.168.21.12 set status enable next end next end
config system dns-server edit wan1 set mode recursive next end