# config vpn ipsec phase1-interfaceLocal interface used in DNS.
edit "ipsec"
set type dynamic
set interface "port3"
set mode aggressive
set peertype any
set net-device disable
set mode-cfg enable
set ipv4-dns-server1 10.180.20.2
set proposal aes128-sha256 aes256-sha256 aes128-sha1 aes256-sha1
set dpd on-idle
set comments "VPN: ipsec (Created by VPN wizard)"
set xauthtype auto
set authusrgrp "dialup_group"
set ipv4-start-ip 10.10.10.100
set ipv4-end-ip 10.10.10.120
set save-password enable
set client-auto-negotiate enable
set client-keep-alive enable
set psksecret ENC z8ffB+0sD0eDaaTMu7x+0nxRMWZCxiWJPIIqnVIAgzTHrIbOafD7cLfzT4pPR0NuVb4zlLK1jQgQcwd0PXrHHFipcepB9Ft2zWVOxU0hbrQhiRXS0qOPyoKr6F0ydnNHsVPoa402Rlyo7tn6/u63GIM6Xt6FKmg2pQYohEtBBSmhlW5YJNvxiqsNEdZ+mfd/NcDv9Q==
set dpd-retryinterval 60
next
# config system interfaceFirewall policy to allow DNS traffic.
edit "loopback_test"
set vdom "root"
set ip 10.180.20.2 255.255.255.255
set allowaccess ping
set type loopback
set role lan
set snmp-index 14
end
# config firewall policyLocal DNS database configuration.
edit 1
set name "dns_loopback"
set uuid 5d2dbc6c-87e2-51ea-1b9f-8b15babd3dca
set srcintf "ipsec"
set dstintf "loopback_test"
set srcaddr "all"
set dstaddr "all"
set action accept
set schedule "always"
set service "ALL"
next
end
# config system dns-databaseEnable DNS service on both interface (dialup and local interface).
edit "Local-server"
set domain "fortinet.com"
set ttl 900
set authoritative disable
# config dns-entry
edit 1
set hostname "first"
set ip 172.16.1.1
next
end
next
end
# config system dns-serverTesting implementation.
edit "loopback_test"
next
edit "ipsec"
next
end
C:\Users\fortinet>nslookup first.fortinet.com
Server: UnKnown
Address: 10.180.20.2
Non-authoritative answer:
Name: first.fortinet.com
Address: 172.16.1.1
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.