Function Reference


Get public IP address of a network/computer

#include <Inet.au3>
_GetIP ( )

Return Value

Success: the public IP address. (See remarks.)
Failure: -1 and sets the @error to non-zero.


This only returns the public IP address of a computer or network (i.e. the public IP on the WAN link of your NAT router). The address is determined by accessing an external IP discovery web site. The sites used are,, and

To reduce overloading the IP discovery sites a 5 minute timer is used between each function call. If _GetIP() is used during this 5 minute period, the previous IP is returned and @extended set to 1.


#include <Inet.au3>
#include <MsgBoxConstants.au3>

Local $sPublicIP = _GetIP()
MsgBox($MB_SYSTEMMODAL, "", "Your external IP address is: " & $sPublicIP)