REST Services Home Page

WS DNS Lookup Service Documentation

Welcome to the WS DNS Lookup Service. This service allows you to perform a DNS lookup by providing a hostname. It’s useful for testing network configurations and ensuring that your application can resolve domain names correctly.

Note for Beginners: In this documentation, you’ll find examples of how to interact with the service using Burp Repeater (for testing purposes) and curl (for command-line users). If you’re new to these tools, follow the steps carefully, and soon you’ll be making requests with ease.

Endpoint

The service is accessible at the following endpoint:

POST /webservices/rest/ws-dns-lookup.php

How It Works

Provide a hostname in the request body, and the service will perform a DNS lookup for that hostname. If the security level is set high, the service will validate the hostname to protect against malicious input.

Request Parameters

Step-by-Step Example Using Burp Repeater

Here’s how to send a request to this service using Burp Repeater:

POST /webservices/rest/ws-dns-lookup.php HTTP/1.1
Host: mutillidae.localhost
Content-Type: application/json
Accept: application/json
Origin: http://mutillidae.localhost
Connection: close

{
    "hostname": "google.com"
}

Instructions:

  1. Open Burp Suite and navigate to the Repeater tab.
  2. Copy the above request and paste it into the Repeater window.
  3. Click Send to see the response from the server.

Example Using curl (Command Line)

If you prefer using the command line, here’s how you can make the same request with curl:

curl -X POST "http://mutillidae.localhost/webservices/rest/ws-dns-lookup.php" \
 -H "Content-Type: application/json" \
 -H "Host: mutillidae.localhost" \
 -H "Accept: application/json" \
 -H "Origin: http://mutillidae.localhost" \
 -H "Connection: close" \
 -d '{"hostname": "google.com"}'

Instructions:

  1. Open a terminal or command prompt.
  2. Copy and paste the above curl command.
  3. Press Enter to send the request and view the response.

Expected Response

If everything works correctly, you will receive a response like this:

{
    "hostname": "google.com",
    "command": "nslookup 'google.com'",
    "security-level": 5,
    "result": "Server:  8.8.8.8\nAddress: 142.250.190.78"
}
Troubleshooting Tips: If you encounter any issues:

Learn More

If you want to explore more, try providing different hostnames and observe the results. For example, you can send the hostname example.com and check if it resolves correctly.