James Smith wrote:
> Hi all.
> 
> Here is a problem I have been pulling my hair out over.  I want to do an
> NSLookup directly (ie: no custom tags if it can be avoided) and have tried
> both w3sockets and TCPClient to open the socket but not for love nor money
> can I find the appropriate commands to send.
> 
> I can use either to connect to a POP3 server, login, read mail etc.... but I
> just cant get DNS queries to work.
> 
> Can anyone point me in the correct direction?

honestly the best advice here is don't re-invent the wheel.. use 
cfexecute and dig from sendmail/bind or maybe a java class

this code using dig will give u really detailed info about dns

<cfsavecontent variable="dig_out"><cfexecute name="#server.dig_exe#"
        arguments="#attributes.domain# +nssearch " timeOut="5"></cfexecute>
</cfsavecontent>
<cfscript>
        soa_pos=FindNoCase("SOA",dig_out,1);
        if (soa_pos gt 0){
                soa_server=ListGetAt(dig_out,2," ");
                request.mod.dnsdig.status=1;
        } else {
                // name server soa not found!
                soa_server="";
                request.mod.dnsdig.status=-1;
        }
        </cfscript>
<cfif len(soa_server) gt 0>
<cfsavecontent variable="request.mod.dnsdig.info"><pre>
        <cfexecute name="#server.dig_exe#"
        arguments="@#soa_server# #attributes.domain# axfr +multiline"
                                timeOut="5"></cfexecute></pre></cfsavecontent>

the short explanation is SOA is the master server for a domain, u can 
only get the detailed info from the master server, you first get the SOA 
server, then u query the SOA server for the domain info


is there a reason why you don't want to use custom tags??? what are u 
wanting to do?

z


______________________________________________________________________
Signup for the Fusion Authority news alert and keep up with the latest news in 
ColdFusion and related topics. http://www.fusionauthority.com/signup.cfm
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

Reply via email to