Выбрать главу

ns2.pearson.com.          78028 IN A  195.69.215.15

oldtxdns2.pearsontc.com. 139762 IN A  192.251.135.15

;; Query time: 50 msec

;; SERVER: 192.168.0.1#53(192.168.0.1)

;; WHEN: Sun Oct 28 20:02:53 2007

;; MSG SIZE rcvd: 166

And here is a reverse lookup with dig:

$ dig 195.69.212.200

; <<>> DiG 9.5.0a6 <<>> 195.69.212.200

;; global options: printcmd

;; Got answer:

;; ->>HEADER<<- opcode: QUERY, status: NXDOMAIN, id: 53249

;; flags: qr rd ra; QUERY: 1, ANSWER: 0, AUTHORITY: 1, ADDITIONAL: 0

;; QUESTION SECTION:

;195.69.212.200.                IN A

;; AUTHORITY SECTION:

.                         10800 IN SOA A.ROOT-SERVERS.NET. NSTLD.VERISIGN-GRS.COM. 2007102800 1800 900 604800 86400

;; Query time: 47 msec

;; SERVER: 192.168.0.1#53(192.168.0.1)

;; WHEN: Sun Oct 28 20:03:49 2007

;; MSG SIZE rcvd: 107

host

A command-line utility, host performs forward and reverse lookups by querying DNS nameservers, similar to dig.

Here's an example of a forward lookup with host:

$ host www.pearson.com

www.pearson.com has address 195.69.212.200

Here's a reverse lookup with host:

$ host 195.69.212.200

200.212.69.195.in-addr.arpa domain name\

pointer www.environment.pearson.com.

200.212.69.195.in-addr.arpa domain name\

pointer booktime.pearson.com.

200.212.69.195.in-addr.arpa domain name\

pointer environment.pearson.com.

nslookup

A command-line utility, nslookup can be used in an interactive or noninteractive manner to query DNS nameservers. Note that nslookup is outdated; try using dig instead.

Here's an example of a forward lookup using nslookup:

$ nslookup www.pearson.com

Server:  192.168.0.1

Address: 192.168.0.1#53

Non-authoritative answer:

Name: www.pearson.com Address: 195.69.212.200

Here's a reverse lookup using nslookup:

nslookup 195.69.212.200

Server:  192.168.2.1

Address: 192.168.2.1#53

Non-authoritative answer:

200.212.69.195.in-addr.arpa name = environment.pearson.com.

200.212.69.195.in-addr.arpa name = www.environment.pearson.com.

200.212.69.195.in-addr.arpa name = booktime.pearson.com.

Authoritative answers can be found from:

212.69.195.in-addr.arpa nameserver = ns2.pearson.com.

212.69.195.in-addr.arpa nameserver = ns.pearson.com.

ns2.pearson.com internet address = 195.69.215.15

Note that using a reverse lookup does not tell you the FQDN of the server using that IP address. To determine that, you have to use the whois client.

whois

A command-line utility from the whois package, whois queries various whois servers across the Internet.

For an IP lookup:

$ whois 165.193.130.83

[Querying whois.arin.net]

[whois.arin.net]

OrgName:    Savvis

OrgID:      SAVVI-3

Address:    3300 Regency Parkway

City:       Cary

StateProv:  NC

PostalCode: 27511

Country:    US

NetRange:   165.193.0.0 - 165.193.255.255

CIDR:       165.193.0.0/16

NetName:    SAVVIS

NetHandle:  NET-165-193-0-0-1

Parent:     NET-165-0-0-0-0

NetType:    Direct Allocation

NameServer: NS01.SAVVIS.NET

NameServer: NS02.SAVVIS.NET

NameServer: NS03.SAVVIS.NET

NameServer: NS04.SAVVIS.NET

NameServer: NS05.SAVVIS.NET

Comment:

RegDate:

Updated:    2007-09-18

OrgAbuseHandle: ABUSE11-ARIN

OrgAbuseName:   Abuse

OrgAbusePhone:  +1-877-393-7878

OrgAbuseEmaiclass="underline"   abuse@savvis.net

OrgNOCHandle: NOC99-ARIN

OrgNOCName:   SAVVIS Support Center

OrgNOCPhone:  +1-888-638-6771

OrgNOCEmaiclass="underline"   ipnoc@savvis.net

OrgTechHandle: UIAA-ARIN

OrgTechName:   US IP Address Administration

OrgTechPhone:  +1-888-638-6771

OrgTechEmaiclass="underline"   ipadmin@savvis.net

# ARIN WHOIS database, last updated 2007-10-27 19:10

# Enter ? for additional hints on searching ARIN's WHOIS database.

And for a domain name lookup (which is not what whois is used for):

$ whois www.pearson.com

Whois Server Version 2.0

Domain names in the .com and .net domains can now be registered

with many different competing registrars. Go to http://www.internic.net

for detailed information.

No match for "WWW.PEARSON.COM".

Configuring a Local Caching Nameserver

A caching nameserver builds a local cache of resolved domain names and provides them to other hosts on your LAN. This speeds up DNS searches and saves bandwidth by reusing lookups for frequently accessed domains and is especially useful on a slow dialup connection or when your ISP's own nameservers malfunction.

If you have BIND and BIND-utils installed on your computer, you can configure a caching nameserver by installing the caching-nameserver package. This sets up the /etc/named.conf configuration file, the /var/named directory, and the configuration files in /var/named (localhost.zone, named.ca, and named.local).

To start the caching nameserver, you can start the named service manually (see Chapter 11, "Automating Tasks") or use the system-config-services GUI configuration tool. Choose the Services menu option in the Server Settings menu, which is in the System Settings menu, and then select named and click the Start button.