#!/bin/sh for target in $@; do ip=$(dig $target +short) printf "%-20s -> %20s (%s)\n" "$target" "$(dig -x $ip +short)" "$ip" done