Basic DNS server configuration example
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.
In this example, the Local site is configured as an unauthoritative primary DNS server.
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 Primary.
-
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, example.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.
-
Configure the remaining settings as needed. The options might 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 port1.
-
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 primary set view shadow set ttl 86400 set primary-name corporate set contact admin@example.com set authoritative disable config dns-entry edit 1 set status enable set hostname web set type A set ip 172.16.200.254 next end next end
config system dns-server edit port1 set mode recursive next end
To verify the configuration:
-
Send a DNS query for a DNS entry configured locally on the Local site FortiGate:
C:\Users\demo>nslookup office.microsoft.com Server: Unknown Address: 172.16.200.1 Non-authoritative answer: Name: web.example.com Address: 172.16.200.254
The query is resolved to the IP address configured in the shadow DNS database on the Local site FortiGate.
-
Send a DNS query for a domain that is not configured on the Local site FortiGate:
C:\Users\demo>nslookup facebook.com Server: Unknown Address: 172.16.200.1 Non-authoritative answer: Name: facebook.com Addresses: 157.240.22.35
The query is resolved by the central DNS server.