
Enabling DNSSEC validation with the root trust anchor in BIND
-------------------------------------------------------------

You need to log in to your resolver (cache) machine, i.e. for group 1, you
would use resolv.grp1.ws.nsrc.org, as you did when you enabled recursion on
that server.

1. Grab the root key

    NOTE: This is only for the purpose of this lab - if using unbound 
    on the Internet, you would simply use "unbound-anchor" to download 
    the real root.key, and set "auto-trust-anchor-file:" in unbound.conf, 
    and let unbound update the key when necessary.

    from monitor.dnssek.org
    --------

    Go to https://monitor.dnssek.org/, and copy the trust-anchor
    statement (the ENTIRE line) from this page. (In unbound
    you would paste it into the file
    /usr/local/etc/unbound/root.key)

    Using "dig"
    ------------------------------

    You could also:

    $ dig -t dnskey . @10.10.0.232
 
     and copy the longest DNSKEY record assming it is the KSK.

    Question: Why is this bad?


Now edit the /etc/namedb/named.conf, and paste the key in the following format:

    trusted-keys {
       // paste here the contents
    };

    named.conf should look something like this when done:

    # cat /etc/namedb/named.conf

    options {
        directory       "/etc/namedb/working";
        pid-file        "/var/run/named/pid";
        dump-file       "/var/dump/named_dump.db";
        statistics-file "/var/stats/named.stats";
	recursion yes;
        dnssec-validation yes;
        allow-query { any; };
    };
    zone "." {
        type hint;
        file "/etc/namedb/named.root";
    };
    trusted-keys {
       "." 257 3 8
         "AwEAAagAIKlVZrpC6Ia7gEzahOR+9W29euxhJhVVLOyQ
          bSEW0O8gcCjFFVQUTf6v58fLjwBd0YI0EzrAcQqBGCzh
          /RStIoO8g0NfnfL2MTJRkxoXbfDaUeVPQuYEhg37NZWA
          JQ9VnMVDxP/VHL496M/QZxkjf5/Efucp2gaDX6RS6CXp
          oY68LsvPVjR0ZSwzz1apAzvN9dlzEheX7ICJBBtuA6G3
          LQpzW5hOA2hzCTMjJPJ8LbqF6dsV6DoBQzgul0sGIcGO
          Yl7OyQdXfZ57relSQageu+ipAdTTJ25AsRTAoub8ONGc
          LmqrAmRLKBP1dfwhYB4N7knNnulqQxA+Uk1ihz0=";
    };

   Again, make sure to respect "'s and ;'s.

2. Restart the nameserver

    # service named restart

3. Run a few queries:

    $ dig @localhost +dnssec . SOA
    $ dig @localhost +dnssec mytld. SOA

    What do you notice ?

4. If you haven't already done so, you can go back to the DNS logging exercise,
   and enable logging on your RESOLV host, and look at the dnssec log file...

