Client Subnet and DNS server
You can call the API by sending HTTP GET requests to
http://[32 random alphanumeric characters].edns.ip-api.com/json
Alternatively, for automatic redirection (slower)
Please make sure to make the request from the client's browser. Sending this request from your own server will return the DNS info for that server, which is probably not useful.
dns contains the IP address and Geolocation (country, ISP) of the DNS server the client used.
edns contains the IP address and Geolocation (country, ISP) of the client. If the DNS server did not send the client subnet, the edns field will be be absent.
Results are cached for 60 seconds from the time of the DNS query. If the requested result (domain) expired, the user will be redirected to a new, randomly generated domain.
We are whitelisted for edns-client-subnet with Google Public DNS and OpenDNS.
Testing the API
Test via Google Public DNS:
API_HOST=$(</dev/urandom tr -dc a-z0-9|head -c32).edns.ip-api.com; API_IP=$(dig $API_HOST +short @188.8.131.52); curl -H "Host: $API_HOST" http://$API_IP/json
Test via OpenDNS:
API_HOST=$(</dev/urandom tr -dc a-z0-9|head -c32).edns.ip-api.com; API_IP=$(dig $API_HOST +short @184.108.40.206); curl -H "Host: $API_HOST" http://$API_IP/json
By default there is no callback function called, but you can supply your own with the GET parameter
We do not allow commercial use of this endpoint. Please see our pro service for SSL access, unlimited queries and commercial support.