代码: 全选
$ nslookup
Default server: localhost
Address: 127.0.0.1
Let's try to resolve a host name, for example "www.NetBSD.org":
代码: 全选
> www.NetBSD.org
Server: localhost
Address: 127.0.0.1
Name: www.NetBSD.org
Address: 204.152.190.12
代码: 全选
> www.NetBSD.org
Server: localhost
Address: 127.0.0.1
Non-authoritative answer:
Name: www.NetBSD.org
Address: 204.152.190.12
The results of this first test confirm that the server is working correctly.
We can also try the host(1) and dig(1) commands, which give the following result.
代码: 全选
$ host www.NetBSD.org
www.NetBSD.org has address 204.152.190.12
$
$ dig www.NetBSD.org
; <<>> DiG 8.3 <<>> www.NetBSD.org
;; res options: init recurs defnam dnsrch
;; got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 19409
;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 5, ADDITIONAL: 0
;; QUERY SECTION:
;; www.NetBSD.org, type = A, class = IN
;; ANSWER SECTION:
www.NetBSD.org. 23h32m54s IN A 204.152.190.12
;; AUTHORITY SECTION:
NetBSD.org. 23h32m54s IN NS uucp-gw-1.pa.dec.com.
NetBSD.org. 23h32m54s IN NS uucp-gw-2.pa.dec.com.
NetBSD.org. 23h32m54s IN NS ns.NetBSD.org.
NetBSD.org. 23h32m54s IN NS adns1.berkeley.edu.
NetBSD.org. 23h32m54s IN NS adns2.berkeley.edu.
;; Total query time: 14 msec
;; FROM: miyu to SERVER: 127.0.0.1
;; WHEN: Thu Nov 25 22:59:36 2004
;; MSG SIZE sent: 32 rcvd: 175