File systems and Name services
Two completely different things that are actually quite similar. It all comes down to storing, finding and updating an item given a key.
In order to communicate we need to find the other party. Instead of keeping an address or communication channel open it is better to refer to object using a name . The name is then resolved each time we need to access the service. How are names constructed and how are they resolved? Is there a difference between names and addresses?
File systems make use of name services to locate items. It then provides the means to update these items. We normally see file systems as very different to name services but the propblems we encounter are very similar.
When distributing services we encounter a problem of consistency. How do we guarantee that all clients actually have the same image of the service. We need to be able to talk about consistency of services and realize that sometimes it might not be feasible nor necessary to provide strong consistency guarantees.
Build your own DNS proxy
Here is some undocumented code that will implement a small DNS proxy. You can start your own DNS-proxy on for example port 5300 and then direct your operating system to us this as your dns resolver. Once you start to understand what it looks like you should be able to do some caching etc.
The trickiest part is how messages are encoded since this is quite spaghetti like. In order to save few bytes DNS messages are encoded in a not so friendly manner.