# how DNS works

The Domain Name System (DNS) resolves names to data such as IP addresses through client-server queries, including recursion, iteration, and caching.

This is one page of public article previews, not the complete archive. Follow Next page to continue. Summaries are not the original full articles.

## Building a DNS Server That Resolves Requests to Cats

DevFeed: [Building a DNS Server That Resolves Requests to Cats](<https://devfeed.tech/articles/oops-i-accidentally-the-whole-dns-35533.md>)

Original publisher: [Read original article](<https://meowni.ca/posts/oops-cat-dns/>)

Author: Monica Dinculescu

Published: 2014-02-06T00:00:00Z

Content type: opinion

Language: en

Sources: [Monica Dinculescu](<https://devfeed.tech/sources/monica-dinculescu.md>)

Topics: [how DNS works](<https://devfeed.tech/topics/how-dns-works.md>), [servers](<https://devfeed.tech/topics/servers.md>), [Caching](<https://devfeed.tech/topics/caching.md>), [authoritative name server](<https://devfeed.tech/topics/authoritative-name-server.md>), [Internet](<https://devfeed.tech/topics/internet.md>)

Tags: [authoritative-name-server](<https://devfeed.tech/tags/authoritative-name-server.md>), [caching](<https://devfeed.tech/tags/caching.md>), [dns](<https://devfeed.tech/tags/dns.md>), [how-dns-works](<https://devfeed.tech/tags/how-dns-works.md>), [server](<https://devfeed.tech/tags/server.md>)

### AI overview

A work-in-progress account of building a DNS server that resolves every request to cats. The article also explains the DNS resolution process, including recursive caching, root, top-level-domain, and authoritative name servers, and describes the challenges of parsing and testing DNS.

### Source excerpt

Here is my confession, internet: I am writing a cat DNS. That is, a DNS server that resolves everything to cats. You want your email? Cat! You want to check the weather? Cat! It's always cat. Wait why? We were talking at work about DNSes, and it turns out I only hand wavingly know how they work. I also like things that troll you. The reason why this post is about what I'm doing and not about what I've done, is because my server isn't done yet. Let me try to explain. The DNS spec is ridiculous. I genuinely don't want to parse it; It's got a billion fields, it's written in Courier New, and it is really boring. Pros: I have found a nodejs project on github that I'm working from. Cons: it doesn't work for me. Testing the DNS server is ridiculous. You take your DNS server for granted, dear reader. I know this, because the moment I set my crappy, barely-running, returning-nothing service as my DNS, a hundred thousand requests started coming in. You see, every service in the universe (gmail, hangouts, apple notifications, twitter) polls their mothership every second to check for updates. All these polls come to your server. All you want is to try to go to www.google.com in a tab and see what happens. It meeps, that's what happens. MEEP. DNS: How do it do it? You know how DNS works. You give a server a human readable hostname, like www.google.com, and it gives you back the IP address (like 74.125.226.113) where the thing you are looking for actually lives. Here's pretty much how it goes. You type in www.google.com. We're off to the races! This goes to a recursive caching name server, which, after doing some work, will give you the IP you need. This name server has a list of hints, such as addresses of root name serves, and most likely a cache of popular requests. Let's say it doesn't have an answer cached, which means it will go ask a root nameserver. A root nameserver might not know the IP of your service, but knows the IP of the top level domain you need to speak to (in t