# GET-IP.RC # # Function to get the IP for a specified host. # # nslookup -query=txt host.example.com (using NSLOOKUP to get SPF record) # host -t txt host.example.com (using HOST ditto) # LOCALBUFFER='zilch' :0 * ! LOCALDOMAIN ?? (altavista\.com|\ amazon\.com|\ aol\.com|\ apple\.com|\ att\.net|\ attbi\.com|\ cnn\.com|\ comcast\.net|\ cs\.com|\ earthlink\.(com|net)|\ example\.(com|net|org)|\ excite\.com|\ geocities\.com|\ google\.com|\ hinet\.net|\ hotmail\.com|\ macromedia\.com|\ microsoft\.com|\ mindspring\.com|\ msn\.com|\ netscape\.net|\ sonic\.net|\ terra\.es|\ tripod\.com|\ tripod\.co\.[a-z][a-z]|\ w3\.org|\ yahoo\.[a-z][a-z][a-z]?(\.[a-z][a-z])?) { LOCALBUFFER=`${SBHOST} ${LOCALHOST} ${SBNAMESRVR}` } :0 * ! LOCALBUFFER ?? zilch * ! LOCALBUFFER ?? ^Host.*not found.*$ * ! LOCALBUFFER ?? ^.*connection timed out.*$ * ! LOCALBUFFER ?? \*\* server can\'t find( ) * SBHOST ?? nslookup { LOCALIP=`${ECHO} "${LOCALBUFFER}" | ${SED} -e '/^Note:.*$/d' -e '/^Consider using the.*$/d' -e '/^option to prevent this message.*$/d' -e '/Server:.*$Address:.*$/d' -e '/^$/d' -e '/Non-authoritative answer:.*$/d' -e '/Name:.*$/d' -e 's/^Address:[^0-9]*//' | ${TR} '[\n]' ' ' | ${SED} -e 's/ .*$//' -e '2,$d'` } :0 * ! LOCALBUFFER ?? zilch * ! LOCALBUFFER ?? ^Host.*not found.*$ * ! LOCALBUFFER ?? ^.*connection timed out.*$ * ! LOCALBUFFER ?? \*\* server can\'t find( ) * SBHOST ?? host { LOCALIP=`${ECHO} "${LOCALBUFFER}" | ${SED} -e '/^Using domain server:$/d' -e'/is a nickname for/d' -e '/mail is handled/d' -e '/^Name:/d' -e '/^Address:/d' -e '/Aliases:/d' -e '/^$/d' -e '/is an alias for/d' -e 's/^.*has address //' | ${TR} '[\n]' ' ' | ${SED} -e 's/ .*$//' -e '2,$d'` } :0 * LOCALIP ?? ^$ { LOCALIP=000.000.000.000 }