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 --iteration tests for domains with different kinds of authorities #118

Closed
paul-pearce opened this issue Aug 30, 2017 · 6 comments
Closed

Comments

@paul-pearce
Copy link
Contributor

Specifically, we should test that different kinds of authorities, such as non second-level-domains should function.

A challenge here is that our test domain may not easily facilitate this. @zakird?

@dadrian dadrian mentioned this issue Aug 31, 2017
@dadrian dadrian changed the title More involved tests should be added for --iteration Add tests --iteration for domains with different kinds of authorities Aug 31, 2017
@dadrian dadrian changed the title Add tests --iteration for domains with different kinds of authorities Add --iteration tests for domains with different kinds of authorities Aug 31, 2017
@dadrian
Copy link
Member

dadrian commented Aug 31, 2017

I don't quite understand what you mean. What kind of test domain do you want?

@paul-pearce
Copy link
Contributor Author

paul-pearce commented Aug 31, 2017

For example. I want an A record for dog.cat.example.com, where the authoritative is cat.example.com not example.com. (Clearly example.com is also authoritative, but I want it to not respond with an A but rather delegate to cat.example.com).

This would have caught #117

There are plenty of examples of this, but we need to setup our test domain to do this, and I don't know what the constraints of our hosting are.

@dadrian
Copy link
Member

dadrian commented Sep 1, 2017

Can you post what the record we'd need to set are? Then myself or @zakird can look into how we would set them.

@paul-pearce
Copy link
Contributor Author

Here's an example

$ echo "star.c10r.facebook.com" | ./zdns/zdns A --iterative --trace | jq "."
{
  "trace": [
REMOVED
    {
      "cached": false,
      "layer": "facebook.com",
      "depth": 3,
      "name_server": "69.171.239.12:53",
      "name": "star.c10r.facebook.com",
      "class": 1,
      "type": 1,
      "results": {
        "flags": {
          "error_code": 0,
          "response": true,
          "opcode": 0,
          "authoritative": false,
          "truncated": false,
          "recursion_desired": false,
          "recursion_available": false,
          "authenticated": false,
          "checking_disabled": false
        },
        "protocol": "udp",
        "authorities": [
          {
            "answer": "a.ns.c10r.facebook.com",
            "name": "c10r.facebook.com",
            "class": "IN",
            "type": "NS",
            "ttl": 3600
          },
          {
            "answer": "b.ns.c10r.facebook.com",
            "name": "c10r.facebook.com",
            "class": "IN",
            "type": "NS",
            "ttl": 3600
          }
        ],
        "additionals": [
          {
            "answer": "2a03:2880:fffe:b:face:b00c:0:99",
            "name": "a.ns.c10r.facebook.com",
            "class": "IN",
            "type": "AAAA",
            "ttl": 3600
          },
          {
            "answer": "69.171.239.11",
            "name": "a.ns.c10r.facebook.com",
            "class": "IN",
            "type": "A",
            "ttl": 3600
          },
          {
            "answer": "2a03:2880:ffff:b:face:b00c:0:99",
            "name": "b.ns.c10r.facebook.com",
            "class": "IN",
            "type": "AAAA",
            "ttl": 3600
          },
          {
            "answer": "69.171.255.11",
            "name": "b.ns.c10r.facebook.com",
            "class": "IN",
            "type": "A",
            "ttl": 3600
          }
        ],
        "answers": []
      }
    },
    {
      "cached": false,
      "layer": "c10r.facebook.com",
      "depth": 4,
      "name_server": "69.171.239.11:53",
      "name": "star.c10r.facebook.com",
      "class": 1,
      "type": 1,
      "results": {
        "flags": {
          "error_code": 0,
          "response": true,
          "opcode": 0,
          "authoritative": true,
          "truncated": false,
          "recursion_desired": false,
          "recursion_available": false,
          "authenticated": false,
          "checking_disabled": false
        },
        "protocol": "udp",
        "authorities": [
          {
            "answer": "a.ns.c10r.facebook.com",
            "name": "c10r.facebook.com",
            "class": "IN",
            "type": "NS",
            "ttl": 3600
          },
          {
            "answer": "b.ns.c10r.facebook.com",
            "name": "c10r.facebook.com",
            "class": "IN",
            "type": "NS",
            "ttl": 3600
          }
        ],
        "additionals": [
          {
            "answer": "2a03:2880:fffe:b:face:b00c:0:99",
            "name": "a.ns.c10r.facebook.com",
            "class": "IN",
            "type": "AAAA",
            "ttl": 3600
          },
          {
            "answer": "69.171.239.11",
            "name": "a.ns.c10r.facebook.com",
            "class": "IN",
            "type": "A",
            "ttl": 3600
          },
          {
            "answer": "2a03:2880:ffff:b:face:b00c:0:99",
            "name": "b.ns.c10r.facebook.com",
            "class": "IN",
            "type": "AAAA",
            "ttl": 3600
          },
          {
            "answer": "69.171.255.11",
            "name": "b.ns.c10r.facebook.com",
            "class": "IN",
            "type": "A",
            "ttl": 3600
          }
        ],
        "answers": [
          {
            "answer": "157.240.17.14",
            "name": "star.c10r.facebook.com",
            "class": "IN",
            "type": "A",
            "ttl": 60
          }
        ]
      }
    }
  ],
  "data": {
    "flags": {
      "error_code": 0,
      "response": true,
      "opcode": 0,
      "authoritative": true,
      "truncated": false,
      "recursion_desired": false,
      "recursion_available": false,
      "authenticated": false,
      "checking_disabled": false
    },
    "protocol": "udp",
    "authorities": [],
    "additionals": [],
    "answers": [
      {
        "answer": "157.240.17.14",
        "name": "star.c10r.facebook.com",
        "class": "IN",
        "type": "A",
        "ttl": 60
      }
    ]
  },
  "timestamp": "2017-09-01T10:56:48-07:00",
  "status": "NOERROR",
  "class": "IN",
  "name": "star.c10r.facebook.com"
}

@phillip-stephens
Copy link
Contributor

If I'm understanding the ask correctly, I think I added this in #374. More details available in that PR, but there's unique nameservers for zdns-testing.com, subdomain0.zdns-testing.com and subdomain1.subdomain0.zdns-testing.com and I test if iterative resolution works in this controlled context.

What I think I'll add is if we run with --result-verbosity trace, I should be able to validate that at each level of the iteration, we asked the correct name server. So for resolving a.subdomain1.subdomain0.zdns-testing.com, we should first try the nameservers for zdns-testing.com, then the next layer, then get our final answer.

@zakird
Copy link
Member

zakird commented Jun 12, 2024

I don't think that #374 really tests complex iterative cases, the test is a pretty trivial best-case-scenario, but with a large number of names. Overall, we don't really have any tests that actually make sure the logic in our iterative resolver is particularly resiliant. That said, this issue is pretty poorly defined and since nobody seems to know what it's aiming for, I think it's fair to close it and focus on more concrete issues.

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

No branches or pull requests

4 participants