DNS Connection Question

trlists at clayst.com trlists at clayst.com
Wed Oct 20 09:24:01 EDT 2004


On 20 Oct 2004 Grant M. wrote:

> What exactly is it that you are trying to do? Verify IP addresses? 
> Lookup Hostnames? Something else? Perhaps there is a better way to do it.

Sorry if I didn't make that clear.  A user enters the name of a 
nameserver in a form.  I want to verify at least that it appears to 
exist (easy to do, just a gethostbyname() call) but also, if I can, 
that it is truly a nameserver.  It saves me from dealing with 
everything from typos to malicious entries.  It's by no means perfect --
they can still put in an erroneous nameserver name, for example -- but 
it's better than no verification at all.

Simply making a TCP connection on port 53 works well about 98% of the 
time, but apparently some nameservers are configured to only accept UDP 
on that port, and those my code currently considers to be invalid, 
requiring manual intervention.  That's the problem I'm working on.  
While the systems involved are running Linux, it's really a networking 
question not a Linux question.

--
Tom






More information about the Discuss mailing list