mx=$(host -t mx $1 2>&1) if echo "$mx" | grep "not found:"; then echo "not found"; else echo $mx fi