Skip to content

geodns

Everyone

Perform DNS lookups from multiple locations around the world.

Developer information

The following API method(s) are used:

  • https://geonet.shodan.io/api/geodns/{hostname}

Other references:

  • Geonet API Documentation: https://geonet.shodan.io/docs

Installation

Grab the latest Debian package and install all available geonet commands:

Terminal window
$ wget https://gitlab.com/api/v4/projects/32089582/packages/generic/geonet-rs/latest/geonet_latest_x86_64.deb
$ sudo dpkg -i geonet_latest_x86_64.deb

For MacOS, install the latest version from tap repository with homebrew

Terminal window
$ brew tap shodan-public/homebrew-shodan https://gitlab.com/shodan-public/homebrew-shodan
$ brew install geonet

Prebuilt releases of the individual commands are also available for most x64 platforms. To get the most recent release from the Release page, download the command and chmod it. For example, to download the 0.4.4 Linux x64 release of geoping:

Terminal window
$ wget https://gitlab.com/api/v4/projects/32089582/packages/generic/geonet-rs/0.4.4/geodns-linux-x86_64 -O geodns
$ chmod +x geodns

To build the utilities from source you need to have Rust stable or nightly installed. Afterwards you can simply run:

Terminal window
cargo build --release

The geodns and geoping tools will then be available in the target/release folder.

Usage

The geodns tool requires a single argument: the hostname that should be looked up. A few other options are also supported:

$ geodns -h
geodns 0.4.0
Lookup a DNS record from different locations aorund the world
USAGE:
geodns [OPTIONS] <fqdn>
FLAGS:
-h, --help Prints help information
-V, --version Prints version information
OPTIONS:
-o, --output <output> Output format (shell or json) [default: shell]
-t, --type <rtype> Record type to query [default: A]
ARGS:
<fqdn> Hostname/ domain to get information for

The geodns command supports JSON output using the JSON-NL format which can then be consumed by tools such as jq.

Examples

Lookup the A Records for shodan.io
$ geodns shodan.io
104.18.12.238 Santa Clara
Clifton
London
Amsterdam
Singapore
Frankfurt am Main
Doddaballapura
104.18.13.238 Santa Clara
Clifton
London
Amsterdam
Singapore
Frankfurt am Main
Doddaballapura
Get the IPv6 addresses (AAAA records) for shodan.io
$ geodns --type AAAA shodan.io
2606:4700::6812:cee Santa Clara
Clifton
London
Singapore
Amsterdam
Frankfurt am Main
Doddaballapura
2606:4700::6812:dee Santa Clara
Clifton
London
Singapore
Amsterdam
Frankfurt am Main
Doddaballapura
Get the mail servers (MX records) for shodan.io and output in JSON-NL
$ geodns -o json -t MX shodan.io
{"answers":[{"type":"MX","value":"alt2.aspmx.l.google.com."},{"type":"MX","value":"aspmx.l.google.com."},{"type":"MX","value":"alt1.aspmx.l.google.com."}],"from_loc":{"city":"Santa Clara","country":"US","latlon":"37.3924,-121.9623"}}
{"answers":[{"type":"MX","value":"aspmx.l.google.com."},{"type":"MX","value":"alt2.aspmx.l.google.com."},{"type":"MX","value":"alt1.aspmx.l.google.com."}],"from_loc":{"city":"Clifton","country":"US","latlon":"40.8344,-74.1377"}}
{"answers":[{"type":"MX","value":"aspmx.l.google.com."},{"type":"MX","value":"alt1.aspmx.l.google.com."},{"type":"MX","value":"alt2.aspmx.l.google.com."}],"from_loc":{"city":"London","country":"GB","latlon":"51.5085,-0.1257"}}
{"answers":[{"type":"MX","value":"alt1.aspmx.l.google.com."},{"type":"MX","value":"aspmx.l.google.com."},{"type":"MX","value":"alt2.aspmx.l.google.com."}],"from_loc":{"city":"Amsterdam","country":"NL","latlon":"52.3740,4.8897"}}
{"answers":[{"type":"MX","value":"aspmx.l.google.com."},{"type":"MX","value":"alt1.aspmx.l.google.com."},{"type":"MX","value":"alt2.aspmx.l.google.com."}],"from_loc":{"city":"Frankfurt am Main","country":"DE","latlon":"50.1025,8.6299"}}
{"answers":[{"type":"MX","value":"alt2.aspmx.l.google.com."},{"type":"MX","value":"alt1.aspmx.l.google.com."},{"type":"MX","value":"aspmx.l.google.com."}],"from_loc":{"city":"Singapore","country":"SG","latlon":"1.3215,103.6957"}}
{"answers":[{"type":"MX","value":"alt1.aspmx.l.google.com."},{"type":"MX","value":"aspmx.l.google.com."},{"type":"MX","value":"alt2.aspmx.l.google.com."}],"from_loc":{"city":"Doddaballapura","country":"IN","latlon":"13.2257,77.5750"}}