Upgrade to Pro — share decks privately, control downloads, hide ads and more …

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

Monica Dinculescu

August 01, 2014
Tweet

More Decks by Monica Dinculescu

Other Decks in Programming

Transcript

  1. DNS

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

    TO BE CLOSE TO THE METAL” - SOMEONE ON HACKER NEWS
  3. 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(=^_^=); }
  4. 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(=^_^=); }
  5. 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(=^_^=); }
  6. 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(=^_^=); }
  7. 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(=^_^=); }
  8. 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(=^_^=); }
  9. 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(=^_^=); }