Drop #537 (2024-09-27): Special Delivery Part 1

ip.addr.toolsinfo.addr.toolsmyip.addr.tools

The internet’s plumbing is a complex beast, often opaque to even seasoned sysadmins and developers. Whether you’re wrestling with ACME challenges, need a quick way to check your public IP, or want to swim in the murky waters of DNS, there are lightweight, focused tools that can help.

Today, we’ll cover three tools from a suite of utilities from addr.tools that strip away the cruft and deliver fast and focused functionality for common (and not-so-common) networking tasks. Each tool does one job and does it well, something we fully appreciate here at the Drop.

We’ll cover other ones in future editions.



addr.tools

The internet-based tools we’re covering are all something you can host yourself, thanks to the source being available.

Since there’s no TL;DR today, you may still want to just “get to all the tools” without my blathering, so here they are:

My goal is to fill in the answer to “so what?” for each of these tools (not necessarily in the order, above), and avoid blathering too much for ones with better self-documentation. Let’s dig in!


ip.addr.tools

Photo by Sean Patrick on Pexels.com

ip.addr.tools is a service that lets you create domain names that resolve to any IP address you specify. It’s a handy way to generate a domain name on the fly without needing your own DNS server or domain.

How Does It Work?

  • For IPv4 Addresses:
    • Take an IP address like 192.0.2.1.
    • Replace the dots with hyphens: 192-0-2-1.
    • Add .ip.addr.tools at the end: 192-0-2-1.ip.addr.tools.
    • This domain now resolves to 192.0.2.1.
  • For IPv6 Addresses:
    • Take an IP address like 2001:db8::1.
    • Replace the colons with hyphens and double hyphens for double colons: 2001-db8--1.
    • Add .ip.addr.tools2001-db8--1.ip.addr.tools.
    • This domain resolves to 2001:db8::1.
  • Subdomains Work Too:
    • You can add any subdomain in front, like anything.192-0-2-1.ip.addr.tools.
    • It still resolves to the IP address 192.0.2.1.

Practical Examples:

  • Accessing a Device on Your Network:
    • Suppose you have a router at 192.168.1.1.
    • Use the domain 192-168-1-1.ip.addr.tools to access it via a domain name.
  • Setting Up a Local Server:
    • Your local server is at 10.0.0.5.
    • Use 10-0-0-5.ip.addr.tools as a domain name for testing.
  • IPv6 Devices:
    • For an IPv6 device at fe80::1, use fe80--1.ip.addr.tools.

Getting Your Public IP Address:

  • Visit self.ip.addr.tools to get a domain that resolves to your public IPv4 address.
  • Visit self6.ip.addr.tools for your public IPv6 address.

Obtaining TLS Certificates:

You can get TLS certificates for these domains from certificate authorities like Let’s Encrypt.

  • Using ACME DNS Challenge:
    • You need to add a TXT record to _acme-challenge.your-domain.
    • Use the nsupdate tool to add this TXT record.

Example of Adding a TXT Record:

$ nsupdate -v
> update add _acme-challenge.192-168-1-1.ip.addr.tools 180 TXT "challengeText"
> send
  • Verify the TXT Record:
$ dig _acme-challenge.192-168-1-1.ip.addr.tools txt +short
"challengeText"

Important Notes:

  • For Public IP Addresses:
    • Updates must come from the IP address you’re trying to update.
    • Use TCP for the update request.
    • If you’re updating an IPv4 address, make sure to use IPv4; same for IPv6.
  • Updates Are Temporary:
    • TXT records added are automatically removed after a few minutes.
  • No TSIG Required:
    • TSIG is not needed, but if your client insists, use the provided key information.

Why Use This Service?

  • Quick Domain Setup: Instantly get a domain name pointing to any IP without registration.
  • Testing and Development: Useful if you need domain names for local IPs.
  • SSL Certificates: Obtain HTTPS certificates for services running on specific IP addresses.
  • Dynamic DNS: Acts as a simple dynamic DNS solution for devices with changing IPs.

info.addr.tools

Photo by Castorly Stock on Pexels.com

This tool provides DNS records and Registration Data Access Protocol (RDAP) information for a given IP or domain name.

Each response is useful in different ways:

IP lookup:

  • Provides DNS and RDAP data for the IP
  • Reveals network ownership
  • Shows allocation details and contact information for abuse, administrative, and technical roles

Domain lookup:

  • Provides DNS records (A, NS, SOA) for the domain
  • Shows RDAP data including registrar, registration dates, and nameservers
  • Reveals domain status and privacy protection measures

So, IP lookup helps identify the network provider and contact points for potential abuse or technical issues, and domain lookup provides ownership and technical configuration details, useful for domain management or investigating web properties. Pretty handy!


myip.addr.tools

Photo by cottonbro studio on Pexels.com

The myip.addr.tools service is a straightforward tool that tells you your public IP address. It’s handy for checking your current IP, especially when you’re behind a router or using a VPN. It’s pretty straightforward to use.

Get Your Public IP:

$ curl myip.addr.tools

This command returns your public IP address, like:

203.0.113.45

Get Your IPv4 Address:

$ curl myipv4.addr.tools

This specifically fetches your IPv4 address.

Get Your IPv6 Address:

$ curl myipv6.addr.tools

This retrieves your IPv6 address if you have one.

The service lets you get your IP in various formats by adding paths to the URL.

Plain Text (no newline):

$ curl myip.addr.tools/plain

returns your IP without a trailing newline.

JSON Format:

$ curl myip.addr.tools/json

outputs:

{"ip":"203.0.113.45"}

Custom JSON Key:

$ curl myip.addr.tools/json?key=your_key

results in:

{"your_key":"203.0.113.45"}

For pfSense users:

$ curl myip.addr.tools/pfsense

This returns your IP in a format suitable for pfSense’s IP check.

Some practical examples may be in order.

If you’re writing a script that needs your public IP:

#!/bin/bash
MY_IP=$(curl -s myip.addr.tools)
echo "My public IP is $MY_IP"

Automatically update a DNS record with your current IP:

IP=$(curl -s myip.addr.tools/plain)
curl -X POST "https://dns.example.com/update?ip=$IP"

Quickly confirm you’re online and see your IP:

$ curl myip.addr.tools && echo " - Connected"

Fetch IP in JSON and Parse with jq:

$ curl -s myip.addr.tools/json | jq -r '.ip'

NOTE!

  • The service returns your IP with a trailing newline by default. Use /plain if you don’t want the newline.
  • Always ensure you’re comfortable with any external service you use in scripts, especially for sensitive tasks.

FIN

Remember, you can follow and interact with the full text of The Daily Drop’s free posts on Mastodon via @dailydrop.hrbrmstr.dev@dailydrop.hrbrmstr.dev ☮️

Leave a comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.