Technical Tip: Adding static DNS entry on FortiGate with DHCP assignment
Description
This article describes how to add static DNS entries to resolve domains that are hosted internally and have FortiGate to act as a DHCP and DNS server to provide range of IPs to workstations.
In this scenario, there is an internally hosted website that users need to resolve its domain name to a local IP when trying to access the website. It is possible to configure FortiGate as a DNS server and add a static DNS entry in the DNS server database.
Scope
FortiGate.
Solution
Make sure that in Feature visibility, DNS Database is enabled as shown below. Go to System -> Feature Visibility -> Additional Features -> DNS Database.


edit "port2"
next
end

edit "test"
set domain "example.com"
set authoritative disable
config dns-entry
edit 1
set hostname "test"
set ip 1.1.1.1
next
end
set contact "hostmaster"
next
end

set netmask 255.255.240.0
set interface "port2"
config ip-range
edit 1
set start-ip 172.31.128.2
set end-ip 172.31.143.254
next
end
set dns-server1 172.31.131.2
next
end


