Compare current public IP with a DNS IP record.
Find a file
Courtney Rosenthal 40070077c4
All checks were successful
/ test (push) Successful in 26s
Implemented test action workflow.
2025-10-20 07:26:28 -07:00
.forgejo/workflows Implemented test action workflow. 2025-10-20 07:26:28 -07:00
.gitignore Implemented test action workflow. 2025-10-20 07:26:28 -07:00
check-public-ip.py Initial checkin 2025-10-13 21:56:15 -07:00
LICENSE Initial checkin 2025-10-13 21:56:15 -07:00
Makefile Initial checkin 2025-10-13 21:56:15 -07:00
README.md README updates 2025-10-14 08:16:26 -07:00
requirements.txt Initial checkin 2025-10-13 21:56:15 -07:00
test_check_public_ip.py Suppress stupid type mismatch warnings. 2025-10-13 22:01:26 -07:00

check-public-ip

Compare current public IP with a DNS IP record.

check-public-ip fetches your current public IP address and compares it with the IP address resolved from a specified domain name.

This utility was originally created to verify that a dynamic DNS is kept up-to-date for my home gateway. I run a check periodically out of cron:

*/5 * * * *  nobody  check-public-ip --silent gw.example.org

Usage

check-public-ip [--silent|-s] HOST

Options

  • --silent or -s -- Silent mode: only print output when IPs do not match
  • HOST -- Domain name to check against

Requirements

  • Python 3.x
  • requests library

Installation

Install the required Python dependencies:

pip install -r requirements.txt

Author

Courtney Rosenthal <cr@crosenthal.com>

License

This is free and unencumbered software released into the public domain.

See LICENSE for details.