Skip to main content

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

Project description

PyNslookup

PyPi package

Sensible high-level DNS lookups in Python, using dnspython dns.resolver, code adopted from XN-Twist

The main purpose and uses of this library:

  • A record lookups (typical DNS queries)
  • SOA lookups

Returns an object containing two arrays:

  • response_full: the full DNS response string(s)
  • answer: the parsed DNS answer (list of IPs or SOA string)

Usage

from nslookup import Nslookup

domain = "example.com"

# set optional Cloudflare public DNS server
dns_query = Nslookup(dns_servers=["1.1.1.1"])

ips_record = dns_query.dns_lookup(domain)
print(ips_record.response_full, ips_record.answer)

soa_record = dns_query.soa_lookup(domain)
print(soa_record.response_full, soa_record.answer)

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

nslookup-1.3.0.tar.gz (2.9 kB view hashes)

Uploaded Source

Built Distribution

nslookup-1.3.0-py3-none-any.whl (8.6 kB view hashes)

Uploaded Python 3

Supported by

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