Skip to content

← Blog 01 / Blog Projects

Why DNSCheck has a DNS engine of its own

By 2 minute read Projects

PHP's DNS functions hide exactly what you need to check a domain properly. So for DNSCheck I wrote a small engine in Go.

If you want to check a domain, you want to know more than which IP address belongs to it. Which name server gave that answer? Is the DNSSEC signature valid? How long did it take? PHP's built-in DNS functions cannot tell you any of that: you cannot choose a resolver, cannot check DNSSEC, and you see no error codes, flags or timings.

Walking the path itself

That is why DNSCheck has an engine of its own, written in Go with the miekg/dns library. It starts at the root servers, follows each referral to the name servers of the extension and then to those of the domain itself, and asks them for the answer directly. On the way it records every step and the time it took. The Laravel application does the rest: the pages, the report and the cache.

DNSSEC from the root to the answer

The engine checks the whole chain of trust, from the official root keys to the signature on the answer. It also checks the proof that something does not exist (NSEC and NSEC3). That is exactly where an attacker could otherwise leave something out without anyone noticing.

Checked against a validating resolver

In the first trial I had the engine judge 23 domains six times in a row and compared the result with the validating resolver 1.1.1.1. There was not a single difference, not even for domains whose DNSSEC is broken on purpose.

The trial also found two bugs, which are now kept as tests:

  • Parent and child on the same name servers. Then no referral comes, and the boundary between the zones can only be found through the signature in the answer.
  • Servers that do not know everything. Some servers answer without knowing the domain's keys. One such answer must not be called broken DNSSEC; you ask the domain's own name servers instead.

The result is a report that says what is wrong, why it matters and what to change. Try it yourself at dnscheck.info.

02

Keep reading

→ / Contact

Want to talk it through?

Actions

Schakel naar NederlandsNL