Resolve External IP

by Vitaly, Wednesday, July 1st, 2015

URL to resolve IPv4 address:

http://ipv4.test-ipv6.com/ip/?callback=_jqjsp&asn=1&testdomain=test-ipv6.com&testname=test_asn4

Response (IPv4):

_jqjsp({"ip":"xxx.xxx.xxx.xxx","type":"ipv4","subtype":"","via":"","asn":"yyyyy","asn_name":"Provider Name,US","asnlist":"yyyyy","padding":""})

Extract IPv4 regular expression:

\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}

URL to resolve IPv6 address:

http://ipv6.test-ipv6.com/ip/?callback=_jqjsp&asn=1&testdomain=test-ipv6.com&testname=test_asn6

Response (IPv6):

_jqjsp({"ip":"xxxx:x:xxxx:xxx:xxxx:xxxx:xxxx:xxxx","type":"ipv6","subtype":"Teredo","via":"","padding":""})

Extract IPv6 regular expression:

([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)

Tags: , , ,