Cat-DNS: a DNS server that resolves everything to cats

Cat-DNS: a DNS server that resolves everything to cats

The internet needs more cats. DNS servers are the authority on all things internet. Therefore, the best DNS server is the one that resolves everything to cats. This talk is about that.

Do you think DNS is scary/arcane/confusing? Nope! I'll show you how you can write your own DNS server in less than 200 lines of JavaScript. With cats. We're going to walk through the basics and find out how DNS servers work, how you can talk to a DNS server if you're a browser, and how to talk back to a browser if you are a DNS server.

By the end, you'll know how to what a static IP is, why dig is a hilarious tool if you want to mess around with the internet, how you can write your own DNS server and perhaps most importantly, why you probably shouldn't. And have I mentioned the cats? There will definitely be cats.

Videos of this talk:
https://www.youtube.com/watch?v=qDPhW9P44fI
https://www.youtube.com/watch?v=kvwAIiledvo

053e75a5b48b44d6dd0612795dfb326d?s=128

Monica Dinculescu

August 01, 2014
Tweet

Transcript

  1. MORE CATS THE INTERNET needs

  2. None
  3. I’M MONICA @notwaldorf

  4. DNS

  5. DNS domeow name system

  6. DNS GOOGLE.COM ☛ 74.125.226.134

  7. CAT-DNS GOOGLE.COM ☛ cats? cats!!

  8. None
  9. None
  10. EVEN? HOW DOES it

  11. UDP USER DATAMEOW PROTOCOL

  12. UDP it’s the honey badger

  13. 8.8.8.8

  14. 8.8.8.8 800,000 rEq/sec

  15. 8.8.8.8 70 billion rEq/day

  16. 8.8.8.8 avg: 45 ms

  17. CAT-DNS avg: 7 ms

  18. CAT-DNS but only knows cats

  19. so basically

  20. www.images.google.com? YOU DNS

  21. www.images.google.com? YOU DNS images.google.com TTL: 5 minutes ip: 74.125.226.104

  22. DOMAIN Name Server RNS www.images.google.com? YOU

  23. Recursive Name Server RNS www.images.google.com? YOU

  24. RNS www.images.google.com? I DON’T KNOW BUT I CAN ASK YOU

  25. ROOT RNS images.google.com? ROOT NAME SERVER YOU

  26. ROOT RNS .com .org .biz I KNOW THE TLDS YOU

    images.google.com?
  27. ROOT RNS .com ASK THE .COM SERVER YOU images.google.com?

  28. ROOT RNS .COM YOU images.google.com?

  29. ROOT RNS .COM I’M GETTING HUNGRY YOU

  30. ROOT RNS .COM google yahoo imgur YOU images.google.com?

  31. ROOT RNS .COM GOOGLE YOU images.google.com?

  32. ROOT RNS .COM GOOGLE authoritative YOU images.google.com?

  33. ROOT RNS .COM GOOGLE 74.125.226.135 YOU images.google.com?

  34. 74.125.226.135 ROOT RNS .COM GOOGLE YOU

  35. ROOT RNS .COM GOOGLE YOU yay !

  36. None
  37. CACHING ain’t no one got time

  38. TTL time to live

  39. browser cache chrome://net-internals/#dns

  40. None
  41. WORKS FOR ME BUT not for you…wat?!

  42. www.whatsmydns.net

  43. DANGER ZONE what can go wrong?

  44. DANGER ZONE cache poisoning

  45. ROOT RNS .COM images.google.com? YOU

  46. ROOT RNS .COM ☢ YOU images.google.com TTL: 10000 minutes ip:

    66.000.000.66 images.google.com?
  47. ROOT RNS .COM ☢ YOU trololololololol images.google.com?

  48. None
  49. THE RFC? DID YOU EVEN read

  50. (no)

  51. REALTALK 1987 RFCS ARE PAINFUL RFCS

  52. None
  53. your cat * how to spy on * if your

    cat is a DNS server
  54. NSLOOKUP use: nslookup google.com

  55. None
  56. None
  57. None
  58. DIG use: dig google.com

  59. None
  60. None
  61. None
  62. None
  63. None
  64. None
  65. None
  66. None
  67. None
  68. None
  69. None
  70. 9:30 am yay, code! because

  71. “I'LL OFTEN DROP DOWN TO NODE.JS IF I REALLY NEED

    TO BE CLOSE TO THE METAL” - SOMEONE ON HACKER NEWS
  72. require(‘node-bitarray’) ! require(‘buffer’).Buffer ! require(‘dgram’) ! require(‘ip’)

  73. var dnsServer = dgram.createSocket('udp4'); dnsServer.bind(53,'localhost'); ! dnsServer.on('message', function (msg, rinfo)

    { // Parse message. // Transmogrify into response. // Resolve to cat-service OR imgur. // Giggle. ! dnsServer.send(=^_^=); }
  74. var dnsServer = dgram.createSocket('udp4'); dnsServer.bind(53,'localhost'); ! dnsServer.on('message', function (msg, rinfo)

    { // Parse message. // Transmogrify into response. // Resolve to cat-service OR imgur. // Giggle. ! dnsServer.send(=^_^=); }
  75. var dnsServer = dgram.createSocket('udp4'); dnsServer.bind(53,'localhost'); ! dnsServer.on('message', function (msg, rinfo)

    { // Parse message. // Transmogrify into response. // Resolve to cat-service OR imgur. // Giggle. ! dnsServer.send(=^_^=); }
  76. var dnsServer = dgram.createSocket('udp4'); dnsServer.bind(53,'localhost'); ! dnsServer.on('message', function (msg, rinfo)

    { // Parse message. // Transmogrify into response. // Resolve to cat-service OR imgur. // Giggle. ! dnsServer.send(=^_^=); }
  77. var dnsServer = dgram.createSocket('udp4'); dnsServer.bind(53,'localhost'); ! dnsServer.on('message', function (msg, rinfo)

    { // Parse message. // Transmogrify into response. // Resolve to cat-service OR imgur. // Giggle. ! dnsServer.send(=^_^=); }
  78. var dnsServer = dgram.createSocket('udp4'); dnsServer.bind(53,'localhost'); ! dnsServer.on('message', function (msg, rinfo)

    { // Parse message. // Transmogrify into response. // Resolve to cat-service OR imgur. // Giggle. ! dnsServer.send(=^_^=); }
  79. var dnsServer = dgram.createSocket('udp4'); dnsServer.bind(53,'localhost'); ! dnsServer.on('message', function (msg, rinfo)

    { // Parse message. // Transmogrify into response. // Resolve to cat-service OR imgur. // Giggle. ! dnsServer.send(=^_^=); }
  80. imgur how to be a cat authority

  81. None
  82. NO lessons some lessons are better than

  83. what now? slow dns means less cats

  84. what now? pick a faster one

  85. what now? host your own? bind!

  86. what now? get around geolocation

  87. what now? https:// /notwaldorf/cat-dns

  88. what now? STEALING WIFI JUST GOT WEIRD

  89. @notwaldorf ❤