zdns icon indicating copy to clipboard operation
zdns copied to clipboard

Add --iteration tests for domains with different kinds of authorities

Open paul-pearce opened this issue 8 years ago • 6 comments
trafficstars

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?

paul-pearce avatar Aug 30 '17 23:08 paul-pearce

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

dadrian avatar Aug 31 '17 01:08 dadrian

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.

paul-pearce avatar Aug 31 '17 02:08 paul-pearce

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

dadrian avatar Sep 01 '17 14:09 dadrian

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"
}

paul-pearce avatar Sep 01 '17 18:09 paul-pearce