#!/bin/bash

_help() {
  echo "Usage: $1 [-t TYPE] HOST

  -t        Perform TYPE query.
    TYPE      MX  mail exchanger
  HOST      Domain name or IPv4 address of the host
              of which to retrieve information."
}

test -z "$1" && _help "`basename "$0" 2>/dev/null`" && exit 1

while [ -n "$2" ]; do
  case $1 in
    -t) shift; type="-query=$1";;
  esac
  shift
done

nslookup -silent $type $1

