DNS, Services, and Servers
These days, investigating or troubleshooting a network issue often involves gathering
a variety of information pertinent to affected clients, servers, and network internals
such as protocols, domain name resolution, and IP addressing schemes. PHP offers a
number of functions for retrieving a bevy of information about each subject, each of
which is introduced in this section.
?– Note Several of the functions introduced in this chapter don??™t work on Windows. Check out the PEAR
package Net_DNS to emulate their capabilities.
DNS
The Domain Name System (DNS) is what allows you to use domain names (e.g.,
example.com) in place of the corresponding not-so-user-friendly IP address, such as
192.0.34.166. The domain names and their complementary IP addresses are stored
and made available for reference on domain name servers, which are interspersed
across the globe. Typically, a domain has several types of records associated to it, one
mapping the IP address to the domain, another for directing e-mail, and another for
a domain name alias, for example. Often network administrators and developers
require a means to learn more about various DNS records for a given domain. This
section introduces a number of standard PHP functions capable of digging up a great
deal of information regarding DNS records.
Checking for the Existence of DNS Records
The checkdnsrr() function checks for the existence of DNS records.
Pages:
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483