README FOR hostx 4.2 -------------------- hostx uses the system's native mechanism to look up hostnames or IP addresses. The impetus for creating this script was the lack of such a tool on Mac OS X, where the mechanism can get quite convoluted. INSTALLATION ------------ In the Makefile, set INST_ROOT to wherever you want the software installed. You may also need to change the INSTALL command, depending on the location and version of "install" on your system. Then run "make install". USE --- Run the command with a list of hostnames or IP addresses as arguments. The results of the lookups are printed to standard output. If you specify the "-r" switch, the result from the first lookup will be run through another lookup, so that you can compare forward and reverse lookups for the same thing to see if they match (a common technique in software implementing network-based access restrictions). Specifying the "-m" switch produces tab-delimited output more easily parsed by automated tools (such as "cut"), like this: % hostx -m -r www.occam.com 192.168.1.6 vamana 111.111.111.111 333.333.333.333 www.occam.com 140.239.133.48 occam.com 192.168.1.6 vamana.occam.int 192.168.1.6 vamana 192.168.1.6 vamana.occam.int 111.111.111.111 NO HOSTNAME FOUND 333.333.333.333 INVALID IP ADDRESS instead of the default human-readable output, which looks like this: % hostx -r www.occam.com 192.168.1.6 vamana 111.111.111.111 333.333.333.333 www.occam.com -> 140.239.133.48 -> occam.com 192.168.1.6 -> vamana.occam.int -> 192.168.1.6 vamana -> 192.168.1.6 -> vamana.occam.int 111.111.111.111 -> NO HOSTNAME FOUND 333.333.333.333 -> INVALID IP ADDRESS PLATFORMS --------- hostx has been written for portability to most UNIX systems. It's been tested on the following platforms: - AIX - version 5.3 - *BSD - FreeBSD 4.x - Darwin/Mac OS X - versions 6.x/10.2.x through 9.x/10.5.x - Linux - Red Hat Enterprise Linux 4 - Solaris - versions 2.5.1 through 10 CHANGES ------- You're not required by the license to submit changes back to the source, but I'd appreciate portability improvements or enhancements of general applicability. You can email new versions or contextual diffs ("diff -c old_file new_file") to . Some things to keep in mind if you do this: - Formatting - I use tabs for indentation, and sometimes to align code segments for readability. Please do the same. - Please don't use NotePad or some other Windows editor to make changes. Or if you do, get rid of the DOS linefeeds before submitting changes. - Please try to follow the formatting conventions established in the existing code. - Readability - Usually, I will trade off efficiency (of running time or of development time) in favor of readability. - Insert meaningful comments where appropriate. - Portability - All shell scripts are Bourne-compatible. I won't use shell- specific constructs from bash, ksh, etc. - Don't use OS-specific features, pathnames, etc., unless they're guarded by code checking the OS version, or they're in user-settable variables toward the top of the script. CONTRIBUTORS ------------ Leon Towns-von Stauber Enjoy! Copyright (c) 2003-2008. All rights reserved. See the LICENSE file distributed with this code for restrictions on its use and further distribution. Original distribution available at .