How to Perform a Dns Lookup (Hostname to Ip Address) Using Client-Side JavaScript

Can I perform a DNS lookup (hostname to IP address) using client-side Javascript?

There's no notion of hosts or ip-addresses in the javascript standard library. So you'll have to access some external service to look up hostnames for you.

I recommend hosting a cgi-bin which looks up the ip-address of a hostname and access that via javascript.

Can I perform a DNS lookup (hostname to IP address) using client-side Javascript?

There's no notion of hosts or ip-addresses in the javascript standard library. So you'll have to access some external service to look up hostnames for you.

I recommend hosting a cgi-bin which looks up the ip-address of a hostname and access that via javascript.

access request ip in javascript in the browser

The Web Hypertext Application Technology Working Group (WHATWG) doesn't specify any API for DNS name resolution, only Firefox implements browser.dns.resolve() but this is very unlikely to become part of a standard specification.



Related Topics



Leave a reply



Submit