Looking up hosts under a domain

hello folks,

I am looking for a command on Unix/Linux that will query the hosts connected to a domain..

For Ex: I would like to know what hosts are attached to domain brown.edu . Assume there are:

cs.brown.edu, cob.brown.edu, math.brown.edu, mail.brown.edu, web.brown.edu and so on. So when I query brown.edu it should return all these specific computers that are hooked up to the domain brown.edu.

I tried the linux commands host and nslookup but they didn't return me the hosts attached to a domain, but instead they return the IP address of specific host if that host exists.

regards,

dig -t AXFR domain.tld

allows you to get a zone transfer from the specified domain, what includes a list of all hosts within this domain. Then you could grep the output for all host entries.

Note: zone transfer needs to be allowed on the authoritative name server for the domain and your IP. Otherwise it will not work.

Darwin