skillfed

nslookup

Sensible high-level DNS lookups in Python, using DNSpython resolver

nslookup v1.9.0 107.6K downloads/30d#12,609 on PyPI23
Copyleft license Active released

What it is and what it does

Nslookup is a lightweight wrapper around dnspython that simplifies DNS queries for the most common use cases: looking up A and AAAA records to resolve domain names to IP addresses, and SOA record queries. It abstracts away dnspython's lower-level API to provide straightforward functions that return parsed results and full response strings, with sensible error handling built in.

The library is intentionally narrow in scope—it does not attempt to cover all DNS record types or edge cases, and features like DNS-over-HTTPS are explicitly out of scope. It defaults to UDP queries against system DNS servers but supports custom DNS servers and TCP mode, though the documentation notes that TCP mode creates a new session per query and is resource-intensive for bulk operations.

Use it for:

  • Resolve domain names to IP addresses in a Python application without wrestling with dnspython's full API
  • Perform SOA record lookups to check domain authority or delegation details
  • Query against a specific DNS server (e.g., 1.1.1.1) instead of relying on system defaults
  • Add DNS resolution to a simple script or tool with minimal dependencies and setup

Worth the install?

AI-flagged interpretation of the facts on this page — verify before relying

Provides high-level DNS lookups (A, AAAA, and SOA records) with clean error handling, wrapping dnspython's resolver for common query patterns.

Yes, if you need straightforward DNS lookups for A, AAAA, or SOA records. The single dependency, active maintenance, and low install friction make it a sensible choice for common queries. Skip it if you need advanced DNS features (other record types, DoH, complex error recovery) or bulk TCP queries—use dnspython directly instead.

Install

nslookup on PyPI

pip

pip install nslookup

uv

uv add nslookup

poetry

poetry add nslookup

Installing nslookup

Before you install

Low friction install with a single runtime dependency (dnspython). Actively maintained with recent commits; repository is not archived.

License in practice

Licensed under Mozilla Public License 2.0 (MPL 2.0), a copyleft license requiring derivative works to disclose modifications under the same license terms.

Quickstart

pip install nslookup

from nslookup import Nslookup

dns_query = Nslookup()
ips_record = dns_query.dns_lookup("example.com")
print(ips_record.answer)

Verify before relying

  • Whether the library handles DNS timeouts, retries, or connection failures beyond basic exception handling
  • Performance characteristics when querying many domains in sequence
  • Whether custom DNS server configuration works reliably across different network environments

Package facts

License not declared (copyleft)
Python support not specified
Install friction low — pure-Python wheel
Runtime dependencies 1 — dnspython
Maintenance actively maintained — 103 days since the last release
Last repo commit
First released
Downloads 107,556/month — #12,609 on PyPI (30-day window, as of 2026-08-14)
Known vulnerabilities none known (OSV.dev, checked 2026-08-14)

Evidence: nslookup-1.9.0-py3-none-any.whl

Keywords: dns

Intended Audience :: DevelopersLicense :: OSI Approved :: Mozilla Public License 2.0 (MPL 2.0)Natural Language :: EnglishProgramming Language :: Python :: 3

Tags

dns lookup pythondns query libraryresolve domain nameget ip address dnsdns a record lookupsoa record querysimple dns resolver
dns-resolutionnetwork-utilities

More Internet packages