How a microcontroller the size of a postage stamp can name, find, and resolve everything on your network.


Names are the quiet superpower of networks

Every time you type a web address, an invisible conversation happens. Your device asks, “Where does this name live?” and somebody answers with a number. That somebody is a DNS server, and we usually imagine it as serious infrastructure: a rack in a data center, a router with a big brand name, a Raspberry Pi running a full Linux stack.

What if the answer could come from a few-dollar microcontroller that sips power and boots in a blink?

That is the idea behind two small Arduino libraries: TinyDNS and TinymDNS. Together they turn hobby-grade hardware into a real participant in the naming system of your network.

Why another library? Because “it depends on your board” is a bad answer

Some platforms already ship a piece of this puzzle in their network stack. One core may offer mDNS, another a bare-bones resolver, and a third nothing at all. Each has its own API, its own quirks, and its own gaps. Move your project from one board to another and suddenly your names stop working.

TinyDNS and TinymDNS are built on a different goal: the same full functionality, on every Arduino implementation. They don’t depend on anything the platform stack happens to provide. They only ask for what every Arduino network stack already has: a Client for DNS, or a UDP object for mDNS. Hand them whatever your board uses, and the behavior is the same.

Write it once. Run it anywhere. That’s the promise.

TinyDNS: a DNS server that fits in your pocket

TinyDNS is a header-only DNS library with two personalities.

The client asks questions. It resolves hostnames into IPv4 and IPv6 addresses, and it does so over any network connection your board can open. That includes plain DNS over TCP and DNS over TLS, so your queries can travel encrypted instead of in the clear. A tiny device that cares about privacy: not bad.

The server answers them. It keeps a static table of hostnames you define, remembers recent answers in a cache that forgets the least recently used entries first, and quietly forwards everything it doesn’t know to an upstream resolver. In other words, it behaves like the DNS service you’d expect from a home router, only you wrote the rules.

Think about what that makes possible:

  • Your own private names. Call your devices printer, garden, or nas and have every machine in the house agree.
  • A faster, calmer network. Repeated lookups are answered locally from the cache instead of travelling across the internet again.
  • Control. Pin a name to an address, redirect a service, or keep a lab network self-contained.
  • Room to grow. On boards with extra memory such as PSRAM, the cache can get more generous.

And the price of entry? A cheap Wi-Fi microcontroller, a USB cable, and an afternoon. That’s the cheapest DNS server there is, and it’s one you completely understand.

TinymDNS: let devices introduce themselves

Regular DNS needs somebody to run the phone book. Multicast DNS needs nobody. Devices simply shout their names across the local network, and whoever owns the name answers. It’s the magic behind typing something.local and having it just work.

TinymDNS brings that magic to Arduino. One object does the job: it registers a hostname for your device, answers when someone asks for it, announces its presence when it joins the network, and can look up other .local names too. It follows the mDNS standard (RFC 6762), and because it works with the UDP class of whatever network stack your board uses, it doesn’t matter whether the platform has its own mDNS support or not. ESP32, ESP8266, UNO R4 WiFi, and Pico W boards all speak to it the same way.

The experience changes the moment you use it. No more hunting through a router’s admin page for an IP address. No more sticky notes with numbers. You flash your sensor, power it up, and open weather.local. It feels like the future, and it costs nothing extra.

Better together

The two libraries are complementary halves of a story:

TinymDNS TinyDNS
Scope The local network Names beyond and within your network
Setup Zero configuration You define the table
Best for “Find my device” “Be my resolver”

mDNS lets your gadgets be discovered effortlessly. DNS lets you decide what names mean. One lets devices speak up for themselves; the other lets you set the rules. Combine them and a tiny board can both introduce itself and serve as the directory for everyone else.

Why this is inspiring

We are used to believing that infrastructure has to be big. These libraries argue the opposite: that the foundations of the internet are simple enough, and elegant enough, to run on hardware you could lose in a drawer.

That is good news for learners, who can watch a DNS conversation happen on a device they fully control. It’s good news for makers, who get friendly names and local services for their projects. And it’s good news for anyone who enjoys the feeling of looking at a piece of “serious” technology and realizing: I can build that.

Honest notes

Portability is the goal, and it’s a work in progress. Small is a feature, not a free lunch. Not every network stack can join the multicast group that mDNS needs. Some cores, the UNO R4’s built-in Ethernet among them, are built without the required support. In that case TinymDNS doesn’t give up: it falls back to a plain UDP socket, so your device can still announce itself and look up other names. Answering queries from others may be limited there, so treat that setup as experimental. Some platforms are tested on hardware and others only compile. Check the documentation for your board, and for Wi-Fi boards, switch off power-saving sleep so your device keeps hearing the questions addressed to it.

Your turn

Pick a spare board. Give it a name. Let it answer when someone calls.

Both libraries are open source under the MIT license, with documentation and examples to get you going:

The cheapest DNS server in the world might already be sitting on your desk, waiting for a name.

Categories: Arduino

0 Comments

Leave a Reply

Avatar placeholder

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