Nameserver Lookup Tool
Sure, here's an example of a simple Nameserver Lookup Tool written in HTML with JavaScript that is responsive:
html
Copy code
Nameserver Lookup Tool
Nameserver Lookup Tool
Enter a domain name to look up its nameservers:
In this code, we have an HTML document with a head section containing a viewport meta tag to make the page responsive to different screen sizes. The body contains an h1 header and a brief description of the tool, an input field for the user to enter a domain name, and a button to initiate the lookup. Below that, we have an empty p tag with an id of "result" where the lookup result will be displayed. The JavaScript function lookup() is triggered when the user clicks the "Lookup" button. It first gets the domain name entered by the user using document.getElementById("domainInput").value, and checks if it is not an empty string. If it is empty, it displays an alert asking the user to enter a domain name. If it is not empty, it creates a new XMLHttpRequest object and sets its onreadystatechange property to a function that will be called when the request completes. This function checks if the request is complete and successful (readyState == 4 && status == 200), and if it is, it sets the content of the result paragraph to the response text, which should contain the nameservers for the given domain. The xhr.open() method opens a new GET request to the Google DNS resolver API (https://dns.google/resolve) with the domain name and the query type (NS) as parameters. This will return a JSON response containing the nameservers for the given domain. Overall, this code should provide a simple and responsive Nameserver Lookup Tool that can be used on any device with a web browser
Comments
Post a Comment