Home > Archive > Tcl > April 2005 > [tcllib] dns::resolve and rbl-query
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
| Author |
[tcllib] dns::resolve and rbl-query
|
|
| Giuppech 2005-04-19, 8:58 pm |
| Hi all,
I'm new in tcl (and in programming too, to be honest), so, if
my question is not so interesting, please be patient :-)
I'm trying to do a dns query using the tcllib_dns with the fqdn:
21.189.61.200.sbl-xbl.spamhaus.org
doing a query with dig or with nslookup gives me the right answer
(at the moment I'm writing the ip 200.61.189.21 IS present in
sbl-xbl.spamhaus.org); but with tcl I have this:
% package require dns
1.2.0
% set tok [dns::resolve 21.189.61.200.sbl-xbl.spamhaus.org]
::dns::1
% dns::status $tok
error
if I try www.google.it the dns query works well:
% set tok [dns::resolve www.google.it]
::dns::2
% dns::status $tok
ok
I also tried
dns::resolve {21.189.61.200.sbl-xbl.spamhaus.org}, and
dns::resolve "21.189.61.200.sbl-xbl.spamhaus.org" without changing
results.
Any hints about how to (not mis)use tcllib_dns in my case?
Thanks.
Ciao,
Giuseppe
--
"Guarda, una scimmia a tre teste!
| |
| Pat Thoyts 2005-04-21, 4:00 pm |
| Giuppech <apencil@tiscali.it> writes:
>Hi all,
>I'm new in tcl (and in programming too, to be honest), so, if
>my question is not so interesting, please be patient :-)
>
>
>I'm trying to do a dns query using the tcllib_dns with the fqdn:
>21.189.61.200.sbl-xbl.spamhaus.org
>
>doing a query with dig or with nslookup gives me the right answer
>(at the moment I'm writing the ip 200.61.189.21 IS present in
>sbl-xbl.spamhaus.org); but with tcl I have this:
>
>% package require dns
>1.2.0
>% set tok [dns::resolve 21.189.61.200.sbl-xbl.spamhaus.org]
>::dns::1
>% dns::status $tok
>error
% package require dns
1.2.1
% set tok [dns::resolve dns://london/21.189.61.200.sbl-xbl.spamhaus.org]
::dns::1
% dns::status $tok
ok
% dns::result $tok
{name 21.189.61.200.sbl-xbl.spamhaus.org type A class IN ttl 3600
rdlength 4 rdata 127.0.0.6} {name 21.189.61.200.sbl-xbl.spamhaus.org
type A class IN ttl 3600 rdlength 4 rdata 127.0.0.4}
The above DNS URL syntax is equivalent to using
dns::configure -nameserver london
It isn't obvious if you are using tcp or udp. Some servers will only
work with UDP so that might be an answer. Get the tcludp package for
udp support. The DNS package will use UDP if it can find tcludp.
You might try dns::error $tok to see what the error information is.
--
Pat Thoyts http://www.patthoyts.tk/
To reply, rot13 the return address or read the X-Address header.
PGP fingerprint 2C 6E 98 07 2C 59 C8 97 10 CE 11 E6 04 E0 B9 DD
| |
| Giuppech 2005-04-21, 8:58 pm |
| Il 2005-04-21, Pat Thoyts ha scritto:
> Giuppech <apencil@tiscali.it> writes:
>
[...]
[color=darkred]
> % package require dns
> 1.2.1
[...]
Thanks for your answer and...
shame on me :-/
I found that my problem is archivied as closed-bug #1018934: "dns.tcl
incorrectly detecting query as a reverse lookup", fixed with
version 1.23 of dns.tcl, while I was using the "dns.tcl,v 1.22"...
now I've got the cvs version and all works fine.
Sorry for haven't find it before posting (I looked for), and thank
You again for your answer :-)
Ciao,
Giuseppe
--
"Guarda, una scimmia a tre teste!
|
|
|
|
|