#!/bin/sh
# url: http://pank.org/scripts/
# description: list a domain name server all ip
# comment: csh bash
# platform: freebsd, linux

if [ -z $1 ] ; then
    echo "Usage: `basename $0` {domain}"
else
    for NS in `host -t ns $1 2>/dev/null | awk '{print $NF}'`
    do
        for ADDRESS in `host $NS 2>/dev/null | grep address | awk '{print $NF}'`
        do
            echo $ADDRESS
        done
    done
fi