VPNXray
English

Your public IP for scripts and DynDNS

Free · no signup

One request, one line: your public IP address as plain text. Made for shell scripts, monitoring and dynamic DNS clients.

$ curl https://vpnxray.com/ip
216.73.216.65

Addresses

Plain http:// works too, for routers and older devices that cannot use HTTPS. Prefer HTTPS whenever you can: over plain HTTP, a network in between could alter the answer.

Examples

# Linux / macOS
curl https://vpnxray.com/ip
curl https://v4.vpnxray.com/ip
wget -qO- https://vpnxray.com/ip

# Windows PowerShell
(Invoke-RestMethod https://vpnxray.com/ip).Trim()

# Python 3
import urllib.request
ip = urllib.request.urlopen("https://vpnxray.com/ip").read().decode().strip()

Shortcut: curl vpnxray.com (without /ip) also returns your IP when called from curl or wget.

Dynamic DNS (DynDNS)

Dynamic DNS clients need a web address that returns your public IP. With a recent version of ddclient:

# /etc/ddclient.conf
usev4=webv4, webv4=https://v4.vpnxray.com/ip
usev6=webv6, webv6=https://v6.vpnxray.com/ip

With older versions of ddclient:

# /etc/ddclient.conf
use=web, web=https://v4.vpnxray.com/ip

With OpenWrt (ddns-scripts):

# /etc/config/ddns
option ip_source 'web'
option ip_url 'http://v4.vpnxray.com/ip'

On a router or a NAS, look for a field such as “IP check URL” or “IP detection URL” and enter http://v4.vpnxray.com/ip.

Fair use