DNS query: Difference between revisions
no edit summary
Thundergnat (talk | contribs) m (syntax highlighting fixup automation) |
No edit summary |
||
Line 701:
2001:2f0:0:8800:0:0:1:1
</pre>
=={{header|FutureBasic}}==
FB has several ways to query a DNS server, including this code.
<syntaxhighlight lang="futurebasic">
Str255 UnixCommand
Str255 UnixResponse
print "DNS IPv4 resolved for www.kame.net:"
UnixCommand = "nslookup -querytype=A www.kame.net"
open "UNIX", 1, UnixCommand
while ( not eof( 1 ) )
input #1, UnixResponse
print UnixResponse
wend
close 1
print ""
print "DNS IPv6 resolved for www.kame.net:"
UnixCommand = "nslookup -querytype=AAAA www.kame.net"
open "UNIX", 1, UnixCommand
while ( not eof( 1 ) )
input #1, UnixResponse
print UnixResponse
wend
close 1
handleevents
</syntaxhighlight>
{{output}}
<pre>
DNS IPv4 resolved for www.kame.net:
Server: 2001:1998:f00:2::1
Address: 2001:1998:f00:2::1#53
Non-authoritative answer:
www.kame.net canonical name = mango.itojun.org.
Name: mango.itojun.org
Address: 210.155.141.200
DNS IPv6 resolved for www.kame.net:
Server: 2001:1998:f00:2::1
Address: 2001:1998:f00:2::1#53
Non-authoritative answer:
www.kame.net canonical name = mango.itojun.org.
mango.itojun.org has AAAA address 2001:2f0:0:8800::1:1
mango.itojun.org has AAAA address 2001:2f0:0:8800:226:2dff:fe0b:4311
</pre>
=={{header|Go}}==
|