Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add NS followed by A lookup module #294

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

vishalmohanty
Copy link
Contributor

This diff adds a module that does the following.

  • Does an NS lookup to get all nameservers for a domain.
  • Does an A and/or AAAA lookup based on the ipv4-lookup and ipv6-lookup flag respectively using each of the nameservers from the previous step.

Also added the UTs and Integration tests for the module.

@vishalmohanty vishalmohanty marked this pull request as ready for review March 3, 2022 07:29
@vishalmohanty vishalmohanty requested a review from a team as a code owner March 3, 2022 07:29
@vishalmohanty
Copy link
Contributor Author

vishalmohanty commented Mar 3, 2022

This is how the output looks like
Format of every record:

name_server: {name_server_ip, name_server_name},
ipv4_addresses: []string,
ipv6_addresses: []string,
status: zdns.Status

Running it for zdns-testing:

{
    "data": {
        "ip_records": [
            {
                "ipv4_addresses": [
                    "1.2.3.4",
                    "2.3.4.5",
                    "3.4.5.6"
                ],
                "name_server": {
                    "ip": "216.239.34.108",
                    "name": "ns-cloud-c2.googledomains.com"
                },
                "status": "NOERROR"
            },
            {
                "name_server": {
                    "ip": "2001:4860:4802:34::6c",
                    "name": "ns-cloud-c2.googledomains.com"
                },
                "status": "ERROR"
            },
            {
                "ipv4_addresses": [
                    "3.4.5.6",
                    "1.2.3.4",
                    "2.3.4.5"
                ],
                "name_server": {
                    "ip": "216.239.38.108",
                    "name": "ns-cloud-c4.googledomains.com"
                },
                "status": "NOERROR"
            },
            {
                "name_server": {
                    "ip": "2001:4860:4802:38::6c",
                    "name": "ns-cloud-c4.googledomains.com"
                },
                "status": "ERROR"
            },
            {
                "ipv4_addresses": [
                    "2.3.4.5",
                    "1.2.3.4",
                    "3.4.5.6"
                ],
                "name_server": {
                    "ip": "216.239.32.108",
                    "name": "ns-cloud-c1.googledomains.com"
                },
                "status": "NOERROR"
            },
            {
                "name_server": {
                    "ip": "2001:4860:4802:32::6c",
                    "name": "ns-cloud-c1.googledomains.com"
                },
                "status": "ERROR"
            },
            {
                "ipv4_addresses": [
                    "1.2.3.4",
                    "2.3.4.5",
                    "3.4.5.6"
                ],
                "name_server": {
                    "ip": "216.239.36.108",
                    "name": "ns-cloud-c3.googledomains.com"
                },
                "status": "NOERROR"
            },
            {
                "name_server": {
                    "ip": "2001:4860:4802:36::6c",
                    "name": "ns-cloud-c3.googledomains.com"
                },
                "status": "ERROR"
            }
        ]
    },
    "name": "www.zdns-testing.com",
    "status": "NOERROR",
    "timestamp": "2022-03-02T23:18:47-08:00"
}

Note that IPv6 nameservers do not give any result somehow.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants