DNS server ?

Has anybody built a DNS server in arduino ?

I is a nuisance to tie a PC or RasPi to run a DNS server.
I feel that Arduino can handle a local network of some 10-20 clients, 5-10 servers, 3-4 printers and some 20 Arduino cards easily.
We can writer the IP / name database to a SD card and use some ethernet shied to connect the device to the network.

What's the issue with using a Pi? It's not as if it can't do other things too. Or maybe you don't want to get one specifically for this: consider a Pi zero W.

-" What's the issue with using a Pi?"

It's just that I'm going to need some device in my boat to make book keeping and alarms there. My other RasPis are allready tied to other projects and I'd rather not install DNS to my other servers.
I would not like to buy a Zero for this kind of work, because it is still 30€ + post here in Finland. With that price I get 10 Arduino Nano's. And it still does not contain RJ45 network connector.

In any case DNS might well fit in the memory of an Arduino, so why not ?

That's a steep price for a Pi zero! I expect a Nano could do it although I don't know the specifics. One early thing to figure out I guess is how to get the MAC address from the packet requesting an IP. I don't recall seeing that facility in the library, but it's been a while since I looked at it.

Sounds like an interesting project.

-" Sounds like an interesting project."
It would be, but just now I do not have too much time for it.

DHCP needs MAC to find the right IP.
I do not think DNS does need MAC. I rather believe, that it is kind of table connecting IP and the name.

I have read only some (rather theorethical) descriptions about DNS and I still get a feeling that it is not so complicated as it is described in the fine theories.

If I should build a new DNS system for the world, I would start building tables and a script, which first checks, if the IP is in this LAN and fetch one of the first lines of the table if it is not. Those first lines (until some fancy line) pointing to next level DNS servers IP:s.

There is one problen in the DHCP/DNS system I do not like:

  • The hostname has only one line. If you have two or more network adaptes, say eth0, eth1, wlan0, they still share the same name making the /etc/hosts file funny

mistofeles:
DHCP needs MAC to find the right IP.
I do not think DNS does need MAC. I rather believe, that it is kind of table connecting IP and the name.

D'oh! Conflated the two in my head apparently.

I found pages describing the DNS protocol. It seems to be built for dinosaurs.
I found setDNS from Arduino pages and DNSServer for Arduino but neither has a word of documentation, so they are about useless.

It would be great, if the one, who has had power to write some wonderful packet, has also power to write some documentation.
I remember, when I was a novice with computers (just after the age of dinosaurs), my teacher alway told us that the documentation is more important than the program in most cases. Anyone can write a program, but none can use it without documentation.

mistofeles:
I found setDNS from Arduino pages and DNSServer for Arduino but neither has a word of documentation, so they are about useless.
It would be great, if the one, who has had power to write some wonderful packet, has also power to write some documentation.
I remember, when I was a novice with computers (just after the age of dinosaurs), my teacher alway told us that

And documentation can be very time consuming to write, so all the people who write software for free, may not not be prepared to spend the time to write the documentation for free.

You could of course volunteer to write the documentation ?

No, i do not write documentation to programs some other has built.
It is enough, that I always write some documentation or at least comments to my own programs.
There is even a '#' to help writing some comments inside the program code.