Skip to main content
btie
Staff
Staff
May 23, 2010

Technical Tip: DNS resolution of hostname to IP

  • May 23, 2010
  • 0 replies
  • 22018 views

Description


This article describes how to resolve a hostname to the IP address from the FortiGate CLI.

Scope


For all supported Fortios versions from v6.2.x to v7.6.x.


Solution

 

To perform a hostname resolution from the FortiGate CLI, the following commands can be used:
 
ajoy_0-1669403289638.png

 

execute ping
execute traceroute
 
Both should return the primary IP address for a given domain. It is assumed, that the FortiGate unit has a valid DNS configured.

Here is an example with mylabdomain.com, returning IP address 172.31.1.1

FGT # execute ping mylabdomain.com

PING mylabdomain.com ( 172.31.1.1 ) : 56 data bytes
64 bytes from 172.31.1.1: icmp_seq=0 ttl=245 time=75.4 ms


FGT # execute traceroute mylabdomain.com

traceroute to mylabdomain.com ( 172.31.1.1 ), 32 hops max, 72 byte packets
1 172.31.1.1  0 ms 0 ms 0 ms


If the resolution does not work, refer to:

Technical Note: FortiGate Troubleshooting DNS commands

Thought Leadership Security Summit. Outpace New Threats with AI - enhanced defense. Tuesday, Septmeber 15, 8:30 AM - 2:30 PM PT. The Golf Club at Newcastle, WA.
Virtual event | September 2026. SASE summit. The age of autonomous trust. Register here!