Skip to main content

A tool to perform DNS lookup and open IP addresses in a browser

Project description

nsopen

build

A command-line tool to perform DNS lookups and open resolved IP addresses in a web browser.

Particularly useful when you want to test behind a load balancer that resolves into multiple server IPs.

Installation

python -m pip install .

Usage

Note: pip packages executable directory should be in your PATH environmental variable

# Open all IPs for google.com using HTTPS (default)
nsopen google.com

# Open specific path /elmah.axd on example.com using HTTP protocol
nsopen -p http example.com /elmah.axd

if you didnt install, you can run it via python -m may need to add src folder to PYTHONPATH env var if you are in a different directory

python -m nsopen google.com

Example

nsopen -p https example.com /about

Command line options

usage: nsopen [-h] [-p {http,https}] hostname [path]

Perform DNS lookup and open IP addresses in a browser

positional arguments:
  hostname              The hostname to lookup
  path                  [Optional] path to append to the URL (e.g. /elmah.axd)

options:
  -h, --help            show this help message and exit
  -p, --protocol {http,https}
                        The URL protocol to use (default: https)

Development

Setup

# Install dev dependencies
pip install -r requirements-dev.txt

# (optional) install package in editable mode for CLI entry point
pip install -e .

Test

If you didn't install the package, set PYTHONPATH so tests can import the nsopen package.

# From the project root
$env:PYTHONPATH = "${PWD}\src"; pytest

Tooling

Common tooling is configured in pyproject.toml:

  • black (code formatting)
  • isort (import sorting)
  • flake8 (linting)
  • pytest (test runner defaults)

Run them as needed, e.g.:

black .
isort .
flake8
pytest

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

nsopen-0.1.0.tar.gz (4.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

nsopen-0.1.0-py3-none-any.whl (5.1 kB view details)

Uploaded Python 3

File details

Details for the file nsopen-0.1.0.tar.gz.

File metadata

  • Download URL: nsopen-0.1.0.tar.gz
  • Upload date:
  • Size: 4.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.2

File hashes

Hashes for nsopen-0.1.0.tar.gz
Algorithm Hash digest
SHA256 8bfe97fbb44b804450a571bfa2472ce131f0dbf5a27bae67c349afea8655048b
MD5 8a119a43ed31b7d426e1300aa5ad21bc
BLAKE2b-256 01696c765e9c81cc913127eda22052e2b7169f44673b83b300a90ce2d02ad1a2

See more details on using hashes here.

File details

Details for the file nsopen-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: nsopen-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 5.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.2

File hashes

Hashes for nsopen-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 85870959161b9b0e3f115fbc47e02b186bef76551df0ad4047715a170f1612b2
MD5 b5091acf5a11174b41796bf10a60bf59
BLAKE2b-256 c0600ff3120a02afc1bef463fd03675186bc913af95054566f05d8c4e2e8afef

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page