12 February 2011

How to find out what subdomains are in a domain use the linux command

Subdomain is a separate domain which is a child / child of tld (top level domain it) for example is a subdomain of ndri.info http://a.ndri.info with the subdomain name "a" or www.google.com is a subdomain of google tld . com with the name of the subdomain "www"

The way to find out what subdomains are in a domain / site that I know there are 2 ways. The first way to use the sites dns lookup, the second way is by using linux command dig. Here each way:

1. Using the sites dns lookup

One of the most complete output is http://www.magic-net.nl/dns-lookup.php, just enter the domain address and click the DNS Lookup and results can be enjoyed after the query is completed

2. Using the Linux Command: dig

It's more simple to use tools above, but there are times when someone would prefer a linux command dns lookup tools than the above, especially for the managers of servers that are only dealing with black and white screen (aka console) which can not execute jquery with a text based browser

The way is two steps:

a. See NS (Name Server) which manages the site, with the command:
$ dig domain.com NS

Exp :

$ dig ndri.info NS
; <<>> DiG 9.6.1-P1 <<>> ndri.info NS
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 59703
;; flags: qr rd ra; QUERY: 1, ANSWER: 2, AUTHORITY: 0, ADDITIONAL: 0

;; QUESTION SECTION:
;ndri.info. IN NS

;; ANSWER SECTION:
ndri.info. 85841 IN NS us3.jakhoster.com.
ndri.info. 85841 IN NS us4.jakhoster.com.

;; Query time: 48 msec
;; SERVER: 8.8.8.8#53(8.8.8.8)
;; WHEN: Tue May 4 03:38:49 2010
;; MSG SIZE rcvd: 76

there we can see that the NS who manages ndri.info is us3.jakhoster.com

b. See the list of existing subdomains to dig axfr
$ dig @[NS] domain.com axfr

Exp :
$ dig @us3.jakhoster.com ndri.info axfr
; <<>> DiG 9.6.1-P1 <<>> @us3.jakhoster.com ndri.info axfr
; (1 server found)
;; global options: +cmd
ndri.info. 86400 IN SOA us3.jakhoster.com. support.jakhoster.com. 2010021002 86400 7200 3600000 86400
ndri.info. 14400 IN MX 0 ndri.info.
ndri.info. 86400 IN NS us3.jakhoster.com.
ndri.info. 86400 IN NS us4.jakhoster.com.
ndri.info. 14400 IN A 74.53.97.75
a.ndri.info. 14400 IN A 74.53.97.75
update.a.ndri.info. 14400 IN A 74.53.97.75
www.update.a.ndri.info. 14400 IN A 74.53.97.75
www.a.ndri.info. 14400 IN A 74.53.97.75
ache.ndri.info. 14400 IN A 74.53.97.75
www.ache.ndri.info. 14400 IN A 74.53.97.75
catatan-a.ndri.info. 14400 IN A 74.53.97.75
www.catatan-a.ndri.info. 14400 IN A 74.53.97.75
contoh.ndri.info. 14400 IN A 74.53.97.75
www.contoh.ndri.info. 14400 IN A 74.53.97.75
dabelyudabelyudabelyu.ndri.info. 14400 IN A 74.53.97.75
www.dabelyudabelyudabelyu.ndri.info. 14400 IN A 74.53.97.75
foto-a.ndri.info. 14400 IN A 74.53.97.75
www.foto-a.ndri.info. 14400 IN A 74.53.97.75
ftp.ndri.info. 14400 IN CNAME ndri.info.
keluarga-a.ndri.info. 14400 IN A 74.53.97.75
www.keluarga-a.ndri.info. 14400 IN A 74.53.97.75
kerjaan-a.ndri.info. 14400 IN A 74.53.97.75
www.kerjaan-a.ndri.info. 14400 IN A 74.53.97.75
localhost.ndri.info. 14400 IN A 127.0.0.1
mail.ndri.info. 14400 IN CNAME ndri.info.
update.ndri.info. 14400 IN A 74.53.97.75
update-a.ndri.info. 14400 IN A 74.53.97.75
www.update-a.ndri.info. 14400 IN A 74.53.97.75
www.ndri.info. 14400 IN CNAME ndri.info.
ndri.info. 86400 IN SOA us3.jakhoster.com. support.jakhoster.com. 2010021002 86400 7200 3600000 86400
;; Query time: 275 msec
;; SERVER: 74.53.97.74#53(74.53.97.74)
;; WHEN: Tue May 4 03:40:17 2010
;; XFR size: 31 records (messages 1, bytes 742)

HTH :)

No comments:

Post a Comment