You can’t P2P the DNS and have it too

As DNSSEC evangelist, I am often told that DNSSEC cannot solve the fundamental problem of censorship and domain take down. And I agree. However, these people then follow up with mumblings about “P2P DNS” and how a decentralized DNS would solve this censorship and central control problem.

Unfortunately, per definition, there cannot be a decentralized name lookup service. Let’s take a step back and think again what the DNS is.

An address is only an address if we all agree

I live in Toronto. You might know where that city is located. If not, you can ask someone else you trust. Or you can ask a trusted company, like Google maps, about this “Toronto” thing, and it will tell you where this city is. Or you open 3 different atlas books by different vendors and you look up “Toronto” and compare the results.

The underlying assumption here is that there is only one LOCATION that is known by the NAME Toronto. We all know where “Toronto, Canada” is because we all agreed to name this particular location on the Earth with that globally unique identifier (mnemonic) that is easier to remember then “Let’s have coffee at Latitude 43.6444208 and Longitude -79.4025781”

And we see where this system can break down. Depending on who you ask, “China” refers to something slightly different. According to some, “Taiwan” does not exist. Do you remember a few years back when you suddenly realized that the city of Mumbai was actually what you knew until then as the city of Bombay? In a relatively brief period (a few years) everyone around you started using Mumbai instead of Bombay. This name change came in through some centralized authority and spread down the hierarchy all over the world. The name change within Mumbai undoubtedly went much faster then the update of the school atlas in Wiggins, Mississippi, USA. And just like DNS, this update of a city took some time, because people “knew”  (cached) that it was called Bombay without looking at the new atlas version. Every piece of information update has a “time to live” where you just cannot assume people are aware of the new name.

People have to agree to what an address location is or it won’t work. If I decide
to rename “100 Queen Street West, Toronto” into “Fnord Hall” and no one else knows
about the name change, we won’t be able to meet up for coffee at Fnord Hall because
you have no idea where it is or even how to look up what addressing scheme I used.
Similarly, if the people of Queen Street replace all the signs and decide to call
it King Street, there will be some confusion as to which of the two King Street’s
you might be referring to.

In other words, address agreements are not “peer to peer”. There is a centralized, or rather a hierarchical method for assigning, reassigning and distributing location name updates. And the only reason it works, is because there is censorship and central control.

The DNS is an addressing system. Any P2P DNS alternative still needs to have this property of everyone agreeing to give a certain name to a certain location. And with that comes authority to make changes and disagreements about certain changes (censorship)

The Name mapping problem

The Domain Name System is a lookup mechanism similar to the Geo Location Name System (AKA “atlas”) The DNS serves to match an easy to remember mnemonic (“nohats.ca”) to an impossible to remember IPV4 or IPv6 address. It ensures that no two entities can claim the same mnemonic. And it is also really really big. If we look just at the COM, NET and ORG we’re talking in the order of magnitude of 100 million entries. If you do not live in Canada, your atlas likely does not contain the exact location of 100 Queen Street West, Toronto, Canada. If it did, your house would be filled with just your atlas.

The DNS is hierarchical,and its trust model is hierarchical, assuming you deploy it with DNSSEC. It has censorship and central control. And that’s why it works.

So let’s say you have the perfect decentralized P2P DNS table. It can uniquely represent every “domain name”, using some bitcoin like system of random numbers and transaction logs copied all over the world in shorter times then current DNS TTL levels, supporting over 100M ever changing entries. This in itself would be an incredible, though unlikely, engineering achievement, but let’s assume you people are super smart, outpacing the collective 25 years of IETF DNS experiences, and you managed to built, distribute and continuously update a secure P2P DNS table.

So let’s say my web server is at 438946936129363483649513524349734902630640.namecoin.

Well that’s great. This is about as useful as saying that my web server is at 2001:888:2003:1004:c2ff:eeff:fe00:102. The only difference is that the first would be (assumed) cryptographically secure somehow. But no one is going to advertise their site as 438946936129363483649513524349734902630640.namecoin.

So now you have to design some mapping system, where this name maps to something easy like “nohats.namecoin”. Great, so now who runs this mapping service? Who is preventing someone else from taking” nohats.namecoin” and pointing it to their server? Who is going to release this name in 100 years when I’m long gone? When you start answering these questions, you quickly develop something of a Registry-Registrar-Registrant system, and you just re-implemented DNS except in a new TLD called “.namecoin” (or .onion, or whatever your name scheme will be)

To use this mapping system, you either need to have clients to do the lookups all by themselves (sort of like running a DNS resolver on your laptop) or you are going to chain proxies (sort of like recursive nameservers of your ISP). And guess what, governments will filter it forcing you to use their proxies, which will conveniently filter out some entries. At most, you can reach the level of DNSSEC where this tampering can be detected. But so far, you haven’t actually improved on the current DNS/DNSSEC system.

How can we ensure trust in the mapping service?How can you detect tampering? In the “trust no one” model, this needs to become an “n out of m” trust system. Not even Chuck Norris or Moxie Marlinspike  can vouch for 100M name mappings. Can you trust 100 Ambassadors? Or 90 out of 100? And what do you do when you DO find a lack of trust level in a name mapping? Is your browser just going to fallback to DNS or prompt you with “Add security exception”?

Systems like this have been devised for SSL certificates. CertPatrol, EFF’s trusted certificates, and Moxie’s Convergence all have this problem, and so will any P2P DNS approach. These systems fail because they don’t scale. If an update happens in these systems, these “trusted ambassadors” have to play catch up with reality. So every time your P2P DNS would change its mapping, it will take some time and false positives before things work again. What is really needed is that these updates are authenticated by the publisher, who is the only entity that really knows what is real and what is forged. And this is exactly what DNSSEC provides.

To summarize this part, any cryptographically secure unique identifier that is a replacement for DNS will introduce the exact same problem of needing a mnemonic mapping service that such a new solution is trying to obsolete.

Domain confiscations
Another motivation for P2P DNS is that no central authority can take a name identity away from the “real” owner. ICANN or Verisign can take away any com/net/org domain, and we have seen this happen. The solution is not to replace DNS with some decentralized system, because again that would be moving the problem around.

Who runs the new mapping service? Under what legal system will these mapping servers be running? Or alternatively, which guns are going to enforce that these mapping servers will be hosting, or not hosting, certain content? Or which banks will block payments to keep this alternative name mapping system up and running? Look at how torrenting distributed the crime of downloading movies illegally away from centralized websites to individual participants. People are still sued under the legal system of the physical location they reside in.

Unfortunately, all these new TLDs by ICANN will be under the same controls as com/net/org, so don’t get your hopes up there. The only known solution to defend against this, is to use the TLDs of various different countries at the same time. Remember when wikileaks.org was down and you could still access them via wikileaks.ch, wikileaks.de and wikileaks.is. That’s the only way I know of ensuring your “name” will be up in one of the various legal systems in the world.
Your chances of name survival increases if your do not use US based Registrars and DNS Operators for your non-US based domain registrations, or else you are still putting all your eggs in one legal system.

DNSSEC cannot be trusted because the USG holds the root key.

Finally, people tend to claim that the root key is Sauron’s ring, and whoever has it will get tainted by political or military requests to forge or remove data the DNS hierarchy. And they have the cryptographic key to do so because everyone is forced to trust this key as entry point into the DNS.

First of all, there is an Enigma Problem with that. As soon as someone posts a forged DNS record signed by the root key that is obviously not legitimate, people will quickly move away from such a root key. Very likely, the ccTLDs would get together and create an alternative root zone, split off their hundreds of root nameservers from the Verisign a.root-servers.net server, and then the US would never have this power again in the future. Such an event will happen exactly once.  Whoever would be the target of such forging would have to be a very valuable target indeed. If that is you, you have better things to do then reading this posting.

Second, DNSSEC did not change any of this. The legal system in place already allows the US government to take a domain away. And all the individual countries have similar provisions, or can enact such laws at any time. It is the legal system that will force the hand of the TLD operator. This situation is not different with or without DNSSEC. The
only difference is that with DNSSEC, there is a trail of cryptographic proof, so outsiders
actually can tell much better what happened and who was responsible for it.

More importantly, if you really don’t want to trust Verisign, or PIR, or IANA, you can sit
down with the people you DO trust and start one of these ambassador/convergence schemes for DNSSEC keys just like these systems do for SSL certificates. Collect and distribute all the ccTLD DNSSEC keys and publish it somewhere with appropriate cryptographic security and authenticity. Anyone can then regularly grab that information and prime their DNS servers with it, and all your ccTLDs will be safe from tampering by the US Government, ICANN, Versign, IANA or the root zone operators.

Back to reality: Registrar compromise does affect DNSSEC

A much more likely scenario is that of a compromised registrar, where an attacker gains access to your domain information including NS servers and DNSSEC public key material (DS records) and is able to change the entire domain to point to their own servers, update your DNSSEC trust anchor for theirs, and so validate their hostile take-over as being the cryptographically proven site you are running.

For your own domains, you really want your resolver to hard code that key, overriding any parental DNSSEC information. A registrar compromise will at least not compromise you further as you use passwords or other credentials against what you (cryptographically) think are your own proven servers, but which are really malicious. It might not help the world at large, but if you are guaranteed to find out, at least you can start the repair process. And you already have some kind of monitoring for this in place called “ssh known hosts”.

Image one day you’re having coffee at your local Star Bucks, and you cnnect to your
server and see this:

[paul@thinkpad ~]$ ssh nohats.ca
[paul@thinkpad ~]$ ssh root@nohats.ca
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@ WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED! @
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
IT IS POSSIBLE THAT SOMEONE IS DOING SOMETHING NASTY!
Someone could be eavesdropping on you right now (man-in-the-middle attack)!
It is also possible that a host key has just been changed.
The fingerprint for the RSA key sent by the remote host is
69:e5:1e:eb:2b:7c:71:59:ca:6f:17:3a:ce:6c:80:b6.
Please contact your system administrator.
Update the SSHFP RR in DNS with the new host key to get rid of this message.
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@ WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED! @
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
IT IS POSSIBLE THAT SOMEONE IS DOING SOMETHING NASTY!
Someone could be eavesdropping on you right now (man-in-the-middle attack)!
It is also possible that a host key has just been changed.
The fingerprint for the RSA key sent by the remote host is
69:e5:1e:eb:2b:7c:71:59:ca:6f:17:3a:ce:6c:80:b6.
Please contact your system administrator.
Add correct host key in /home/paul/.ssh/known_hosts to get rid of this message.
Offending RSA key in /home/paul/.ssh/known_hosts:560
RSA host key for nohats.ca has changed and you have requested strict checking.
Host key verification failed.

This particular errors shows up when your server was compromised or your routing was changed, while your DNSSEC was intact. If they had also changed your DNSSEC, you could not see the message about the SSHFP record being incorrect, but you would still see the RSA changed key warning, pointing out a strange new discrepancy between ssh reality and DNSSEC reality

You can decide to monitor a few domains you do not control but that you find important, like twitter or Facebook or Gmail. But again, this runs into the problem described above where you will suffer false positives when they legitimately change something.

DNSSEC actually helps you

With more and more devices running DNSSEC locally, it is actually becoming much harder to spoof or forge DNS. When governments dictate that ISPs need to filter or rewrite DNS requests, DNSSEC will detect this as malicious. This is why SOPA really failed. Not because politicians changed their mind about the legality or morality of hostile domain take over. SOPA failed because the DNS experts convinced the politicians it was totally useless because of DNSSEC.

DNSSEC even helps you against the NSA

Let’s assume Verisign had to give the NSA copies of the private key of the root zone, and the NSA can sign anything from the root down. They don’t have a copy of the .ca key, but since they have the root key, they can replace the public key for .ca (DS record) in the root zone with a new RSA key they just generated for this purpose. And then they repeat this process for “nohats.ca”.

To mislead my readers who think they are going to “nohats.ca”, the NSA intercepts your laptop’s DNS, and uses DNSSEC signed data to convince you my server is in Virginia. Doesn’t this mean DNSSEC would be useless?

Not really. Because this intercepting of your DNS is actually not an easy problem. First of all, they need to hide their tracks. If they change my domains in the “global DNS view”, then this is bound to be detected by me. So they have to do this in a very targeted matter that would only affect you, but not the masses. But with DNSSEC, you can ask any server in the world via any VPN tunnel or TLS connection for DNS data. In fact, currently my laptop will attempt to talk DNS over TLS to Fedora Project DNS servers when it detects that regular port 53 DNS is getting mangled by a hotspot. Or I could be using TCP connections via the TOR network to get my DNS lookups from a server in The Netherlands. Or I would be connected to the Red Hat VPN, and my DNS lookups originate from Rayleigh, North Carolina. So while my laptop is at a certain Star Bucks wifi location in Toronto, the NSA cannot just forge that local hotspot DNS. They will basically have to contaminate the global DNS view to ensure I am being properly misled. So anyone who runs a simple monitor script to check their DNS contents would immediately know their domain’s DNSSEC key was compromised. Or again, you could run some ambassador or n out of m system for this monitoring to detect such DNSSEC key compromise, though this system would also have to deal with false positives when real DNS updates happen.

Note that if the NSA would be that interested in your laptop traffic, they would be better of just redirecting your IP stream and leave the DNS alone. Though that method will finally come to an end soon with the new TLSA DNS record type, which I will explain in another post.

Conclusion

DNSSEC provides valuable additional security to the Domain Name System, even if you believe the root components such as Verisign cannot be trusted. DNSSEC does not protect you against the laws of nation states you disagree with, but then again, no technology does that with perhaps the exception of the cloaking device.

Any P2P DNS system that claims to better then DNSSEC, has not understood the actual problems. You just need to find and point out where in their system they are outsourcing their trust. Just like the DNS system.

ENS Update

For those telling me it can be done and that is what Ethereum Name Service (“ENS”) is, please see this Q&A of me at ICANN60:


Paul Wouters: Let’s say IETF gets the domains IETF in this naming system and we pay our fees for a couple of years. Everybody uses the site. And then at some point we forget to pay and the domain falls back into the pool and somebody else registers it and we don’t know where they are or who they are. Now i go to a court system. I get some legal opinion saying i own this trademark and now i want to get this domain back. Is there any way for me to get this domain back?

Leonard Tan: So right now, the ENS industry, you can change it because it requires four out of seven people. Most of them are ethereum developers. And it is a consensus of them to make any changes. So it is possible, but it is going to be a very difficult thing to do.

So, why have a distributed blockchain based system, when a court system (or Mafia, or a large wad of money( can convice or foce 4 out of 7 people to make a change? You might as well use non-blockchain security, maybe use Shamir’s Secret Sharing instead.

Of course, the question was a double edged sword. If he said it was not possible, he would also show a fundamental problem with ENS – you would then be able to lose your name for a number of reasons and never recover from it. Imagine Coca Cola or Nike losing their brand.

13 thoughts on “You can’t P2P the DNS and have it too

  1. Good discussion we had on twitter.

    My perspective is: We have two separate issues which usually (I believe: erroneously) are dealt as one. They are:
    (1) Trust in the operation of the service (whatever this is, DNS, DNSSEC, Namecoin) and (2) Trust decisions made on its content.

    I opt for a P2P DNS (such as Namecoin), since this is more resilient from the operation-of-the-service point of view. A good implementation of Namecoin in my opinion is more stable against attacks than DNSSEC.

    Your objection stands, however: Who guarantees that whitehouse.bit really is the whitehouse and not somebody else who managed to grab that name earlier. USUALLY this part is also solved in DNS / DNSSEC. My opinion is that the choice, who decides this, should be left to the user. This may be done in the following manner: Namecoin should have various hierarchies or zones embedded: There could be the *.iana.bit hierarchy which is tied to IANA by a certificate. There could be the *.godaddy.bit hierarchy which is tied to godaddy. The normal web user and the grandma-granddad user would probably decide to map the *.godaddy.bit to *, so if grandma accesses whitehouse.com her client would map this to whitehouse.com.godaddy.bit for which Namecoin stores an address resolution managedy by the owner of the godaddy key (as checked by a suitable CA). A different user might map his DNS space to *.iana.bit or to *.cypherpunks.bit. Probably the paranoid hackers would run their own zone on Namecoin. The good news is: Everybody can construct his or her own zone on Namecoin – and whoever want may make his or her choice.

    By this approach we can have both: We can profit from the more secure distributed Namecoin operation (which may be augmented by traditional crypto in subdomains of .bit). And we can have the user decide on which part of the mapping tree he or she places her trust.

    However, for this to work, we must separate two aspects (trust in the operation of a service and trust in the content of a service).

    Trust in the content always is something the power-user will have to do for herself and the john-doe user will delegate to a company. The core advantage is that we can, well, have the one and the other in the same system – which was the reason for my initial reply-tweet.

    I hope this is more clear now. I am looking forward to any flaws or issues my line of reasoning might have and to learn from any critical remarks you might have.

    Best regards
    Clemens.

  2. You are suggesting different people will map the same mnemonic to something else. How can you have the equivalent of URLS without a unique mapping? That is as bad as alternate DNS roots. In your system, the one “grandma” mapping service will be the only one used because it is the only one to be more or less guaranteed to work.

    Then you further strengthen these mappings credentials with some X.509 fairy dust. The whole X.509 won’t work, or if you manage to fix it to the point that it works, you will have obsoleted the above grandma mapping service

  3. I think this problem of trust is about 1 root has control over all TLD’s. I think no1 really cares what happends within the TLD.

    We have many of those, so you have the power to choose your TLD. If you don’t like .ca because they haven’t DNSSEC-signed theirs yet, you can go somewhere else.

    Ultimately one root can point a TLD at any set of nameservers. Yes, people would notice and it could break stuff and it would be a bad thing and all that.

    So all we really need is some way of keeping the root in check, some safety net.

    I really like the words: “trust agility”, I have no idea what it really means in practise, but it sounds cool. :-) And it might apply here.

    Why not create 5 roots that all serve the same data, the same data the original root serves. Just like a lot of the alternative roots we had in the past.

    But with a twist, why not check all of them if they have the same data and the majority wins.

    Now you configure your recursor to point to all 5, maybe even have something at the TLD which says which 3 or 5 the TLD trusts.

    That is the only solution I see.

  4. I’m no expert by any means but I disagree with the assertion that DNS -must- be hierarchical — I think the problem is that DNS resolvers are non-interactive and just force updates down without giving users a chance to approve or deny the change.

    Per your example, sure, the ‘official’ name of a large city in India is now Mumbai, but everyone still knows it used to be called Bombay. If some gov’t redirects the Pirate Bay’s DNS entry to their takedown page, but everyone’s DNS would pop up something letting them make a choice to ignore the update and use a previous value, we could all collectively say “NAY” to the hierarchy. Democracy in action.

    An easily-installable local DNS proxy that remembered resolved sites, and gave the user this kind of choice, would be a neat thing I think. Make it easy to use and people might just go for it.

  5. What you’re saying about addresses (censorship is there because we need an hierarchical system) is almost the same you could say about an enciclopedia: we need a central system of authority because we don’t want to read in the entry of a mass murderer that he was a political genius. But then Wikipedia arrived and, save some occasional glitches, you don’t read anything good on Hitler on Wikipedia. This doesn’t necessarily translate to name resolution, it’s just that your example does not fit.

  6. LetoAms, respectfully, you are completely wrong.

    P2P DNS could be implemented using statistical methods. The idea would be to seed DNS names through the P2P network. During the seeding process, you would query multiple peers around you and compare all their results. Using proper statistical methods you could learn the real address of the name.

    To illustrate, in bioinformatics DNA can be sequenced this way. One type of sequencing has huge throughput, where it gathers the sequence from tissue very quickly but the data is fragmented and you don’t know the ordering of the fragments. Well, using special algorithms, the fragments can be aligned and analyzed statistically to find the ordering.

    Likewise, a random sampling of addresses passed to you from a P2P DNS system could be statistically filtered to find the “real” address. This would be much more secure and private than centralized DNS. Not only that, but the local database on each machine could be encrypted and also homogenized with many nearby peers’ database so that you cannot be identified by your local unique knowledge of addresses. Last but not least, such a protocol could even require that you receive a certificate to verify identity of the site you are visiting. The overall system would be highly secure and provide strong privacy.

    Try to think outside the box once in a while!

  7. The argument that you need a name mapping service in the example of .namecoin doesn’t hold.
    Instead of a ‘name mapping service’ you can use a defined algorithm in the client.
    A simple example:
    For the domain name “google.com” and the algorithm to take a hash of the domain name spelled 100times repeated -> use the hash result as the .namecoin address, embed the ip-address at the .namecoin address and you are done.
    The owner of the .namecoin address can update the embedded ip-address etc.

  8. The problem is really no different than any trust problem, and it’s not necessarily about addresses and it certainly doesn’t have to be hierarchical.

    The fundamental problem is are you who you say you are. Are you who you claim to be. More than that, even if you are who you say you are, are you trustworthy.

    The hierarchical solution is the most obvious one, a central authority defines this individual as this individual and you trust the one central authority. All such central authorities have the obvious innate problems mentioned.

    There is the market approach though, with no central authority, instead, a reputation. A person claims to be who they are, and others assign them a reputation based upon that, and on how they subsequently behave. We ask other people that we trust, what the reputation of the individual is and decide if we trust them.
    This is closer to how we work in reality. While we may believe someone who has credentials from some authority, we don’t in fact trust them until they have personally generated some reputation with us, and that reputation has real value.

    Reputation is the problem that needs to be solved for peer to peer name resolution to be feasible.

Leave a Reply

Your email address will not be published. Required fields are marked *