This was my first real attempt with an NPH script, so please be gentile.
Purely as a matter of terminology, this doesn't appear to be an NPH script. If it is, then you are failing to manually set the Status header. For that matter, even if it is a simple CGI, I don't see where the content-type header is being printed... so, I'm a little curious how it is managing to work at all.
That aside, if your coworkers are used to using dig, why would you try to shift them away from the command line to a browser? I understand your reasoning that no one in your department uses the command line "with much efficiency" but I question your decision to go to a web-based tool. The latter seems to limit even the possibility of efficiency.
For example, I imagine that at least one of your coworkers, even if not very efficient in general, is at least familiar with how to redirect output from dig into a file. With the web-based tool, he'll be reduced to cutting and pasting (or learning a command-line based browser, maybe.)
Creating a more flexible and powerful tool is a great idea, but tacking a web interface onto things doesn't often accomplish that. The command line is your friend!
-sauoq
"My two cents aren't worth a dime.";