Resolving domain names with dig
Want to support HowtoForge? Become a subscriber!
|
To resolve a domain name on the shell, you can use the command dig. Resolving the domain example.com: dig example.com If thedomain can be resolved, the result will be similar to this: ; DiG 9.2.1 howtoforge.com ;; global options: printcmd ;; Got answer: ;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 42946 ;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 0 ;; QUESTION SECTION: ;example.com. IN A ;; ANSWER SECTION: example.com. 84600 IN A 192.168.0.1 ;; Query time: 27 msec ;; SERVER: 212.227.21.251#53(212.227.21.251) ;; WHEN: Wed Oct 26 18:53:32 2005 ;; MSG SIZE rcvd: 48 To check if the local webserver is responsible for this domain use the following command: dig @localhost example.com If you want to know which mailserver is responsible for handling the mail for example.com, you can use the command: dig MX example.com The result will be similar to this: ; DiG 9.2.1 MX howtoforge.com ;; global options: printcmd ;; Got answer: ;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 36769 ;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 0 ;; QUESTION SECTION: ;example.com. IN MX ;; ANSWER SECTION: example.com. 84600 IN MX 10 mail.example.com. ;; Query time: 44 msec ;; SERVER: 212.227.21.251#53(212.227.21.251) ;; WHEN: Wed Oct 26 18:55:37 2005 ;; MSG SIZE rcvd: 53 To get all available options for the dig command, you can run: dig --help A more detailed description you will find in the manpage of the dig command: man dig
|



Recent comments
15 hours 23 min ago
22 hours 4 min ago
1 day 1 hour ago
1 day 3 hours ago
1 day 11 hours ago
1 day 21 hours ago
1 day 22 hours ago
2 days 1 hour ago
2 days 6 hours ago
2 days 6 hours ago