Net::DNS is a collection of Perl modules that act as a Domain Name System (DNS) resolver. It allows the programmer to perform DNS queries that are beyond the capabilities of gethostbyname and gethostbyaddr.

The programmer should be somewhat familiar with the format of a DNS packet and its various sections. See RFC 1035 or DNS and BIND (Albitz & Liu) for details.

A resolver object is an instance of the Net::DNS::Resolver class. A program can have multiple resolver objects, each maintaining its own state information such as the nameservers to be queried, whether recursion is desired, etc.

Returns a list of Net::DNS::RR::MX objects representing the MX records for the specified name; the list will be sorted by preference. Returns an empty list if the query failed or no MX records were found.

This method does not look up A records -- it only performs MX queries.

The 32 bit value returned by the auxiliary YYYYMMDDxx() function will be used as the base for the date-coded zone serial number. Serial number increments must be limited to 100 per day for the date information to remain useful.

As of version 0.55 there is functionality to help you sort RR arrays. 'rrsort()' is the function that is available to do the sorting. In most cases rrsort will give you the answer that you want but you can specify your own sorting method by using the Net::DNS::RR::FOO->set_rrsort_func() class method. See Net::DNS::RR for details.

rrsort() selects all RRs from the input array that are of the type that are defined in the first argument. Those RRs are sorted based on the attribute that is specified as second argument.

There are a number of RRs for which the sorting function is specifically defined for certain attributes. If such sorting function is defined in the code (it can be set or overwritten using the set_rrsort_func() class method) that function is used.

For instance: my @prioritysorted=rrsort("SRV","priority",@rr_array); returns the SRV records sorted from lowest to heighest priority and for equal priorities from heighes to lowes weight.

If the function does not exist then a numerical sort on the attribute value is performed. my @portsorted=rrsort("SRV","port",@rr_array);

If the attribute does not exist for a certain RR than the RRs are sorted on string comparrisson of the rdata.

If the attribute is not defined than either the default_sort function will be defined or "Canonical sorting" (as defined by DNSSEC) will be used.

rrsort() returns a sorted array with only elements of the specified RR type or undef.