Skip to content
Snippets Groups Projects
  1. Jan 25, 2017
  2. Jan 17, 2017
  3. Jan 09, 2017
  4. Jan 08, 2017
  5. Jan 04, 2017
  6. Dec 29, 2016
  7. Dec 15, 2016
  8. Dec 06, 2016
  9. Oct 17, 2016
  10. Sep 23, 2016
  11. Sep 21, 2016
  12. Sep 13, 2016
  13. Aug 19, 2016
    • Robert Edmonds's avatar
      modules: Add new whoami module · b2c753d9
      Robert Edmonds authored and Daniel Salzman's avatar Daniel Salzman committed
      This commit adds a new "whoami" module. It synthesizes an A or AAAA
      record containing the query source IP address, at the apex of the zone
      being served. It makes sure to allow Knot to generate cacheable negative
      responses, and to allow fallback to extra records defined in the
      underlying zone file. The TTL of the synthesized record is copied from
      the TTL of the SOA record in the zone file.
      
      Because a DNS query for type A or AAAA has nothing to do with whether
      the query is occurs over IPv4 or IPv6, this module requires a special
      zone configuration to support both address families. For A queries, the
      underlying zone must have a set of nameservers that only have IPv4
      addresses, and for AAAA queries, the underlying zone must have a set of
      nameservers that only have IPv6 addresses.
      
      To enable this module, you need to add something like the following to
      the Knot configuration file:
      
          mod-whoami:
            - id: default
      
          zone:
            - domain: whoami.domain.example
              file: "/path/to/whoami.domain.example"
              module: [mod-whoami/default]
      
          zone:
            - domain: whoami6.domain.example
              file: "/path/to/whoami6.domain.example"
              module: [mod-whoami/default]
      
      The whoami.domain.example zone file would look something like:
      
          $TTL 1
      
          @       SOA     (
                                  whoami.domain.example.          ; MNAME
                                  hostmaster.domain.example.      ; RNAME
                                  2016051300                      ; SERIAL
                                  86400                           ; REFRESH
                                  86400                           ; RETRY
                                  86400                           ; EXPIRE
                                  1                               ; MINIMUM
                          )
      
          $TTL 86400
      
          @       NS      ns1.whoami.domain.example.
          @       NS      ns2.whoami.domain.example.
          @       NS      ns3.whoami.domain.example.
          @       NS      ns4.whoami.domain.example.
      
          ns1     A       198.51.100.53
          ns2     A       192.0.2.53
          ns3     A       203.0.113.53
          ns4     A       198.19.123.53
      
      The whoami6.domain.example zone file would look something like:
      
          $TTL 1
      
          @       SOA     (
                                  whoami6.domain.example.         ; MNAME
                                  hostmaster.domain.example.      ; RNAME
                                  2016051300                      ; SERIAL
                                  86400                           ; REFRESH
                                  86400                           ; RETRY
                                  86400                           ; EXPIRE
                                  1                               ; MINIMUM
                          )
      
          $TTL 86400
      
          @       NS      ns1.whoami6.domain.example.
          @       NS      ns2.whoami6.domain.example.
          @       NS      ns3.whoami6.domain.example.
          @       NS      ns4.whoami6.domain.example.
      
          ns1     AAAA    2001:db8:100::53
          ns2     AAAA    2001:db8:200::53
          ns3     AAAA    2001:db8:300::53
          ns4     AAAA    2001:db8:400::53
      
      The parent domain would then delegate whoami.domain.example to
      ns[1-4].whoami.domain.example and whoami6.domain.example to
      ns[1-4].whoami6.domain.example, and include the corresponding A-only or
      AAAA-only glue records.
      
      To test this locally, I stubbed out the zones in my Unbound
      configuration:
      
          server:
              domain-insecure: "whoami.domain.example"
              domain-insecure: "whoami6.domain.example"
      
          stub-zone:
              name: "whoami.domain.example"
              stub-addr: <IPv4 address that Knot listens on>
      
          stub-zone:
              name: "whoami6.domain.example"
              stub-addr: <IPv6 address that Knot listens on>
      b2c753d9
  14. Aug 06, 2016
  15. Aug 03, 2016
  16. Jul 20, 2016
  17. Jul 13, 2016
  18. Jun 27, 2016
  19. Jun 22, 2016
  20. Jun 10, 2016
  21. Jun 03, 2016
  22. Apr 13, 2016
  23. Mar 24, 2016
  24. Feb 09, 2016
  25. Jan 15, 2016
  26. Jan 14, 2016
  27. Jan 10, 2016
  28. Jan 08, 2016
  29. Dec 28, 2015
  30. Dec 18, 2015
  31. Dec 17, 2015
  32. Dec 11, 2015