Skip to main content
Pre-release

This release is a pre-release and may not be stable for production use.

get-local-address

A simple utility to determine the local IP address that would be used to communicate with a specified remote UDP server.

Description

This program creates a UDP socket, connects it to a target server (default: Cloudflare's DNS at 1.1.1.1:53), and then retrieves the local IP address that would be used for this connection. This is particularly useful for systems with multiple network interfaces to determine which interface would be used to reach a specific destination.

Features

  • Configurable target address and port
  • Lightweight, dependency-free
  • Cross-platform

Installation

pip install get-local-address

After installation, run it as get_local_address.

Usage

get_local_address [-a ADDRESS] [-p PORT] [-h]

Options

Option Description
-a, --address ADDRESS Target server address (default: 1.1.1.1)
-p, --port PORT Target server port (default: 53)
-h, --help Show help message

Output

The program outputs the local IP address that would be used to communicate with the specified server, e.g.:

192.168.1.5

Limitations

  • Only supports IPv4 addresses
  • Requires network connectivity to the target server (though no actual packets are sent)
  • May not work correctly with some firewall configurations

License

MIT License

Release files for get-local-address 0.1.0a1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for get-local-address 0.1.0a1
File Size Uploaded
get_local_address-0.1.0a1.tar.gz 3.2 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for get-local-address 0.1.0a1
File Interpreter ABI Platform
get_local_address-0.1.0a1-py2.py3-none-any.whl Python 2, Python 3 none any Details

Total release size: 7.0 kB

Release files / get_local_address-0.1.0a1.tar.gz

Download URL get_local_address-0.1.0a1.tar.gz
Size 3.2 kB
Tags Source
SHA-256 checksum
How to use checksums
367d797edf01dbd1941f453ce96a7df1a02d66cbd9e96645098bb6f51749888b
BLAKE2b-256 checksum
How to use checksums
fc809c94b69b13e1621f92b4500e9a8a2e09272308bdea4d94bfa5bad9fdaa5a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.13.12

Release files / get_local_address-0.1.0a1-py2.py3-none-any.whl

Download URL get_local_address-0.1.0a1-py2.py3-none-any.whl
Size 3.8 kB
Tags Python 2 Python 3
SHA-256 checksum
How to use checksums
5bfd057dac553eb105d9bc76a78c2499d6c10a7047a5a08310fc1b2044a8e790
BLAKE2b-256 checksum
How to use checksums
728f3e8b13e6a7a108af0e3cf0bddd83d0a1a52fbdc7dcc0483fcb04054e41aa
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.13.12

Release history Release notifications | RSS feed

This release

0.1.0a1 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page