Plan 9 from Bell Labs’s /usr/web/sources/contrib/anothy/bin/rc/host

Copyright © 2021 Plan 9 Foundation.
Distributed under the MIT License.
Download the Plan 9 distribution.


#!/bin/rc

rfork en

if (~ $#* 0) {
	echo 'usage: host target [target...]' >[2=1]
	exit usage
}

for (i in $*) {
	ifs='' Arec=`{echo $i ip | ndb/dnsquery | sed 's/\> //g'}
	ifs='' MXrec=`{echo $i mx | ndb/dnsquery | sed 's/\> //g'}
#echo $Arec
	echo $Arec $MXrec | awk '
		$2 ~ "ip" {print "'$i' has address " $3}
		$2 ~ "mx" {print "'$i' mail is handled by " $3 " " $4}
	'
}

Bell Labs OSI certified Powered by Plan 9

(Return to Plan 9 Home Page)

Copyright © 2021 Plan 9 Foundation. All Rights Reserved.
Comments to webmaster@9p.io.