Back to blog
DevOps 2 min read

What's my IP address?

Easy command line tool for finding your public IP address. No browser needed.

3 October 2017

TL;DR

Run curl in.je/ip to get your public IP address instantly from the command line.

Voer curl in.je/ip uit om direct je publieke IP-adres vanuit de commandoregel te krijgen.

Ejecuta curl in.je/ip para obtener tu dirección IP pública al instante desde la línea de comandos.

The problem

When reviewing logs or troubleshooting network issues, you often need to identify your external IP address. Most people by now use NAT at home, which means standard tools like ifconfig or ipconfig only reveal your internal network address.

You could log into your router or visit a website, but there's a faster way.

The solution: in.je/ip

I built a simple service that returns your public IP address, accessible via standard command-line tools:

# Using curl
$ curl in.je/ip
66.249.76.156

# Using wget
$ wget -qO - in.je/ip
66.249.76.156

The service executes quickly — typically around 0.1 seconds — making it perfect for scripts and automation.

Additional features

The tool supports multiple output formats and additional data types:

Reverse DNS lookup

$ curl in.je/ip/rdns
crawl-66-249-76-156.googlebot.com

Available endpoints

  • /ip — Plain text IP address
  • /ip/rdns — Reverse DNS lookup
  • /ip/json — JSON formatted response
  • /ip/xml — XML formatted response
  • /ip/geoip — GeoIP information

Use cases

In shell scripts

#!/bin/bash
MY_IP=$(curl -s in.je/ip)
echo "Current IP: $MY_IP"

# Use in firewall rules, DNS updates, etc.

Quick check

Perfect for when you need to quickly verify your external IP, especially when:

  • Troubleshooting VPN connections
  • Verifying proxy configurations
  • Setting up firewall whitelists
  • Debugging network issues

Why command line?

Command-line accessibility eliminates browser navigation overhead, enabling direct integration with scripts and pipe operations for automation purposes. It's the Unix way — small tools that do one thing well.

Try it yourself: curl in.je/ip

Het probleem

Bij het controleren van logs of het oplossen van netwerkproblemen moet je vaak je externe IP-adres identificeren. De meeste mensen gebruiken tegenwoordig NAT thuis, wat betekent dat standaard tools zoals ifconfig of ipconfig alleen je interne netwerkadres tonen.

Je zou kunnen inloggen op je router of een website bezoeken, maar er is een snellere manier.

De oplossing: in.je/ip

Ik heb een eenvoudige service gebouwd die je publieke IP-adres retourneert, toegankelijk via standaard commandoregel-tools:

# Met curl
$ curl in.je/ip
66.249.76.156

# Met wget
$ wget -qO - in.je/ip
66.249.76.156

De service werkt snel — meestal rond de 0,1 seconden — waardoor het perfect is voor scripts en automatisering.

Extra functionaliteit

De tool ondersteunt meerdere uitvoerformaten en aanvullende gegevenstypen:

Reverse DNS lookup

$ curl in.je/ip/rdns
crawl-66-249-76-156.googlebot.com

Beschikbare endpoints

  • /ip — Platte tekst IP-adres
  • /ip/rdns — Reverse DNS lookup
  • /ip/json — JSON geformatteerd antwoord
  • /ip/xml — XML geformatteerd antwoord
  • /ip/geoip — GeoIP informatie

Gebruikssituaties

In shell scripts

#!/bin/bash
MY_IP=$(curl -s in.je/ip)
echo "Huidig IP: $MY_IP"

# Gebruik in firewall regels, DNS updates, etc.

Snelle check

Perfect voor wanneer je snel je externe IP moet verifiëren, vooral bij:

  • Troubleshooten van VPN-verbindingen
  • Verifiëren van proxy-configuraties
  • Instellen van firewall whitelists
  • Debuggen van netwerkproblemen

Waarom commandoregel?

Toegankelijkheid via de commandoregel elimineert de overhead van browsernavigatie en maakt directe integratie met scripts en pipe-operaties voor automatiseringsdoeleinden mogelijk. Het is de Unix-manier — kleine tools die één ding goed doen.

Probeer het zelf: curl in.je/ip

El problema

Al revisar logs o solucionar problemas de red, a menudo necesitas identificar tu dirección IP externa. La mayoría de las personas ahora usan NAT en casa, lo que significa que las herramientas estándar como ifconfig o ipconfig solo revelan tu dirección de red interna.

Podrías iniciar sesión en tu router o visitar un sitio web, pero hay una forma más rápida.

La solución: in.je/ip

Construí un servicio simple que devuelve tu dirección IP pública, accesible mediante herramientas estándar de línea de comandos:

# Usando curl
$ curl in.je/ip
66.249.76.156

# Usando wget
$ wget -qO - in.je/ip
66.249.76.156

El servicio se ejecuta rápidamente — típicamente alrededor de 0,1 segundos — haciéndolo perfecto para scripts y automatización.

Características adicionales

La herramienta soporta múltiples formatos de salida y tipos de datos adicionales:

Búsqueda DNS inversa

$ curl in.je/ip/rdns
crawl-66-249-76-156.googlebot.com

Endpoints disponibles

  • /ip — Dirección IP en texto plano
  • /ip/rdns — Búsqueda DNS inversa
  • /ip/json — Respuesta formateada en JSON
  • /ip/xml — Respuesta formateada en XML
  • /ip/geoip — Información GeoIP

Casos de uso

En shell scripts

#!/bin/bash
MY_IP=$(curl -s in.je/ip)
echo "IP actual: $MY_IP"

# Usar en reglas de firewall, actualizaciones DNS, etc.

Verificación rápida

Perfecto para cuando necesitas verificar rápidamente tu IP externa, especialmente cuando:

  • Solucionas problemas de conexiones VPN
  • Verificas configuraciones de proxy
  • Configuras listas blancas de firewall
  • Depuras problemas de red

¿Por qué línea de comandos?

La accesibilidad desde la línea de comandos elimina la sobrecarga de navegación del navegador, permitiendo la integración directa con scripts y operaciones de pipe para propósitos de automatización. Es la forma Unix — herramientas pequeñas que hacen una cosa bien.

Pruébalo tú mismo: curl in.je/ip

Related posts