PInetd: Portable INET Daemon
Mark Karpeles has in fact, written a fully functional DNS daemon in PHP. Goes to prove that you can do anything in PHP. He actually had some solid reasons for doing it as well.
This DNS daemon uses PInetd, which is licensed under GPL 2:
PInetd [1] (Portable INET Daemon) is an Open Source server framework & daemon written in PHP, allowing anyone to easily create a TCP server, daemon, etc.
You can either use it as a developper, and build your own application.
I am planing to build a prototype of a DNSBL. Maybe PInetd is an option for this. We will see, but more about that later.