tags:

views:

255

answers:

2

Is there some API that I can use to build a simple DNS server, preferably in Java? All I want my DNS server to do is answer with the same IP address for any request.

+2  A: 

The DNS protocol is fairly simple, all you need is the ability to catch UDP requests. Once you've captured the request you would then use the appropriate response, or iterative/recursive methods to get unfamilar DNS records. [That requires prior knowledge of DNS servers]

RFC DNS

About DNS

JDNSS may be what you are looking for. It is hosted on SF and it is opensource.

monksy
The DNS protocol is simple??? Either you are a Programming God or you know little about the DNS. Seeing the number of broken DNS software, I believe that the DNS protocol is NOT simple (first example: you mention only UDP while DNS als runs over TCP).
bortzmeyer
It can be done with both, typically it is done with UDP. The protocol for DNS is simple.
monksy
TCP is used with DNS mainly for zone transfers, not for queries; queries use UDP. The complex aspects of DNS involve things like caching, support for recursive queries, support for multiple query types, notifications, etc. If you want to respond to all queries with the same answer and don't care about zone transfers, then it's not too bad.
RickNZ
+1  A: 

If all you need is a DNS server returning the same IP address to every request, you can use Simple DNS Plus with the "Fixed IP Address" plug-in. See http://www.simpledns.com/kb.aspx?kbid=1261

Jesper