Closed vishalmohanty closed 15 hours ago
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.
This diff adds a module that does the following.
NS
lookup to get all nameservers for a domain.A
and/orAAAA
lookup based on theipv4-lookup
andipv6-lookup
flag respectively using each of the nameservers from the previous step.Also added the UTs and Integration tests for the module.