Make sure exec.test cleans up better
[jimtcl.git] / examples / dnstest.tcl
blob905ecb816dd8bd6dfe16b032539155f145a249f2
1 lappend auto_path [pwd]
2 package require dns
4 # Use google's DNS
5 dns::configure -nameserver 8.8.8.8
7 puts "Resolve with udp"
8 set tok [dns::resolve www.tcl.tk]
9 puts status=[dns::status $tok]
10 puts address=[dns::address $tok]
11 puts names=[dns::name $tok]
12 dns::cleanup $tok
14 # Now with tcp
15 dns::configure -protocol tcp
17 puts "Resolve with tcp"
18 set tok [dns::resolve www.google.com]
19 puts status=[dns::status $tok]
20 puts address=[dns::address $tok]
21 puts names=[dns::name $tok]
22 dns::cleanup $tok