A simple, fast command-line tool for geolocating IP addresses and domain names written in Rust.
- π Fast - Built with Rust for optimal performance
- π IP Geolocation - Query geolocation data for any IP address
- π Domain Resolution - Automatically resolves domains to IPs and geolocates them
- π°οΈ Tracing Animation - Shows an animated trace while processing a target
- πΊοΈ Map Options - View coordinates on an interactive terminal map, a local
asciimapweb map, or Google Maps - π» CLI Tool - Simple command-line interface
- π¦ Single Binary - No runtime dependencies, just download and run
Install using your favorite AUR helper:
# Using yay
yay -S geolocate-rs
# Using paru
paru -S geolocate-rs
# Or manually
git clone https://aur.archlinux.org/geolocate-rs.git
cd geolocate-rs
makepkg -si- Rust and Cargo (install from https://rustup.rs/ or
sudo pacman -S rust)
# Clone the repository
git clone https://github.com/r3dg0d/geolocate.git
cd geolocate
# Build in release mode
cargo build --release
# The binary will be at: target/release/geolocateTo install system-wide:
sudo cp target/release/geolocate /usr/local/bin/Check the Releases page for pre-built binaries.
# Start interactively and enter a target when prompted
geolocate-rs
# Geolocate an IP address
geolocate-rs 8.8.8.8
# Geolocate a domain name
geolocate-rs github.com
# Geolocate a full URL
geolocate-rs https://www.google.com$ geolocate-rs 8.8.8.8
Tracing 8.8.8.8 complete.
Target: 8.8.8.8
IP: 8.8.8.8
Location: Ashburn, Virginia, United States
Coordinates: 39.03, -77.5
Would you like to see it on a map? [y/N]:$ geolocate-rs github.com
Tracing github.com complete.
Target: github.com
IP: 140.82.116.4
Location: San Francisco, California, United States
Coordinates: 37.7823, -122.391
Would you like to see it on a map? [y/N]:$ geolocate-rs https://www.reddit.com
Tracing https://www.reddit.com complete.
Target: https://www.reddit.com
IP: 151.101.1.140
Location: San Francisco, California, United States
Coordinates: 37.7823, -122.391
Would you like to see it on a map? [y/N]:After geolocation completes, choose whether to view the result on a map:
Would you like to see it on a map? [y/N]: y
Show map in terminal or web? [terminal/web]:- terminal: opens an auto-centered,
asciimap-style terminal viewport with land, water, city, and graticule glyphs. Use arrows or WASD to pan,+/-to zoom, mouse drag/scroll to navigate,rto reset, andq, Esc, or Enter to close. The redPmarks the geolocated target. - web: prints a local
asciimapURL with the target coordinates, plus a Google Maps fallback. Start it withcd asciimap && npm install && npm run dev.
This tool uses the free ip-api.com service for geolocation data.
Rate Limits:
- Free tier: 45 requests/minute from the same IP
- For higher limits, see ip-api.com/pricing
The tool outputs:
- Target: The original input (IP, domain, or URL)
- IP: The resolved IP address (same as target if IP was provided)
- Location: City, Region, Country
- Coordinates: Latitude and Longitude
- Map Prompt: Optional terminal map or Google Maps URL
- IP Address:
8.8.8.8,2001:4860:4860::8888(IPv4 and IPv6) - Domain Name:
github.com,www.google.com(automatically prependshttps://) - Full URL:
https://example.com,http://example.com
The tool handles various error cases:
- Invalid IP addresses
- Invalid or unresolvable domain names
- Network errors
- API errors
- Rust 1.70+ and Cargo
- Git
# Clone the repository
git clone https://github.com/r3dg0d/geolocate.git
cd geolocate
# Build debug version
cargo build
# Build release version
cargo build --release
# Run tests
cargo test
# Run with a target
cargo run -- 8.8.8.8- clap - Command-line argument parsing
- reqwest - HTTP client
- serde - Serialization framework
- tokio - Async runtime
- dns-lookup - DNS resolution
- url - URL parsing
- crossterm - Terminal input, mouse, and drawing
Contributions are welcome! Please feel free to submit a Pull Request.
- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
MIT License - see LICENSE file for details
- ip-api.com for providing the free geolocation API