A simple Bash script to lookup a hostname and the PTR record of the given IP address at a stroke.
brew tap frdmn/homebrew-formulas brew install odig
Lookup A/CNAMES and reverse lookup them
$ odig frd.mn frd.mn returned the following DNS records: 1. returned IP: 184.108.40.206 resolved PTR: (none) 2. returned IP: 220.127.116.11 resolved PTR: (none)
$ odig www.nsa.gov www.nsa.gov returned the following DNS records: 1. returned hostname (CNAME): www.nsa.gov.edgekey.net. 2. returned hostname (CNAME): e6655.dscna.akamaiedge.net. 3. returned IP: 18.104.22.168 resolved PTR: a23-36-84-226.deploy.static.akamaitechnologies.com.
Lookup MX records and reverse lookup them
$ odig -m google.de google.de returned the following MX records: 1. returned hostname (CNAME): alt2.aspmx.l.google.com. resolved IP: 22.214.171.124 resolved PTR: sc-in-f27.1e100.net. 2. returned hostname (CNAME): alt1.aspmx.l.google.com. resolved IP: 126.96.36.199 resolved PTR: lf-in-f27.1e100.net. 3. returned hostname (CNAME): aspmx.l.google.com. resolved IP: 188.8.131.52 resolved PTR: wm-in-f27.1e100.net. 4. returned hostname (CNAME): alt3.aspmx.l.google.com. resolved IP: 184.108.40.206 resolved PTR: tl-in-f27.1e100.net. 5. returned hostname (CNAME): alt4.aspmx.l.google.com. resolved IP: 220.127.116.11 resolved PTR: tf-in-f27.1e100.net.
- Fork it
- Create your feature branch:
git checkout -b feature/my-new-feature
- Commit your changes:
git commit -am 'Add some feature'
- Push to the branch:
git push origin feature/my-new-feature
- Submit a pull request