Tuesday, December 30, 2025
Home Blog Page 386

PHP: determine the directory path of the server root

It is sometimes necessary to refer to files in the host filesystem explicitly. By retrieving this information dynamically instead of hard coding it, moving the code from one server or hosting company to another is much simpler.

DNS/BIND resource record: using $GENERATE to make many records

A cool feature in versions of BIND since 8.2 and 9.1 is the $GENERATE directive which can create hundreds or thousands of resource records with a single line in zone file. A common use for $GENERATE is assigning PTR records for a DHCP address range.

DNS/BIND resource record: CNAME, canonical names, host aliases

A single host may have multiple personalities: web server (www), mail server (mail, mx), dns server (ns), ftp server (ftp). Rather than assign each of these names an address (A) record pointing to the same IP address, all of which would need to be changed if the IP address changed, one name can be associated with an address record and the remaining names can be aliases for that name. The CNAME record simplifies DNS management, and who doesn’t want that?

DNS/BIND: set TTL for individual resource records

BIND resource records allow an explict TTL value that will override the zone file’s TTL for that specific resource record. One use for this is to prevent non-authoritative servers from caching these records, perhaps in prelude to changing a server’s IP address.

DNS/BIND resource record: PTR reverse lookup record

The PTR (pointer) record maps an IP address to a hostname and fully qualified domain name. Many applications use reverse lookups to identify the domain from which a TCP/IP connection is formed. Best practice for DNS is to create a PTR record for every A record.

Add static host name mappings to a Cisco router

Adding static host name to IP address mappings in a router (like a UNIX /etc/hosts file) can make life easier. These can override DNS entries for the host when needed, and can make easy references to other systems or devices that are not appropriate for DNS entries.

Word 2003: Translate Text to Different Languages

Word 2003 now includes the ability to easily translate text to different languages.

PHP syntax: sort an associative array by value with asort

To sort an associative array by the array values, use asort.

PHP syntax: sort an associative array by index keys

To sort an associative array by index values (or keys), use ksort.

PHP syntax: create an associative array

An associative array can use non-numeric index values and are useful because they can be iterated over sequentially and values can be extracted individually by index. Database select results can be returned as associative arrays in which the column names become indicies.

Latest Articles

Latest Reviews

Latest Comments

error: Content is protected !!