Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to Build a custom simple DNS server in C/C++ [closed]

Tags:

c++

c

dns

I need to build a custom simple non-authoritative caching DNS server in C/C++. Any guidance? Links? Samples?

like image 249
Anton Kopylov Avatar asked Mar 16 '09 08:03

Anton Kopylov


People also ask

What is Cache only DNS server?

A cache-only server is a server that is not a master server for any zone other than the in-addr.arpa. domain. A cache-only server handles the same kind of queries from clients that authoritative name servers perform. But the cache-only server does not maintain any authoritative data itself.


2 Answers

I wrote a basic DNS server for a job interview under BSD license.

May be someone could find it useful:

https://github.com/tomasorti/dns-server

like image 136
nephewtom Avatar answered Sep 28 '22 16:09

nephewtom


If you really need to do that (it is a huge work, see Alnitak's reply), start from an existing good program (not a one-man experiment unmaintained for a long time like djbdns) and modify it.

Unbound is probably a reasonable choice for this. (The code base is smaller than BIND's one.)

like image 28
bortzmeyer Avatar answered Sep 28 '22 18:09

bortzmeyer