Questions tagged [dnspython]

DNSPython is a Python package that provides high and low level access to DNS.

DNSPython is a Python package that provides high and low level access to DNS. Find more information here: http://www.dnspython.org/

116 questions
4
votes
1 answer

TXT records in dnsPython

I have implemented a simple DNS server. It simply responds with a TXT record. I am hosting the script as the NS server for example.com. The NS server is x.y.z.k. It works fine when I issue something like: $ dig demo.example.com @x.y.z.k ; <<>>…
Farid Fadaie
  • 71
  • 1
  • 6
3
votes
5 answers

Python + DNS : Cannot get RRSIG records: No Answer

I get DNS records from a Python program, using DNS Python I can get various DNSSEC-related records: >>> import dns.resolver >>> myresolver = dns.resolver.Resolver() >>> myresolver.use_edns(1, 0, 1400) >>> print myresolver.query('sources.org',…
bortzmeyer
  • 34,164
  • 12
  • 67
  • 91
3
votes
1 answer

DNSSEC Sign RRSET using DNSPython

I'm trying to DNSSEC Sign a RRSET, however I am not able finding any references to how to do so using DNSPython. Yes it has dns.dnssec.validate_rrsig(), but I want to DNSSEC sign a rrset, how can this be done? I've been pooring over the RFC's…
user869887
  • 31
  • 1
3
votes
1 answer

Best approach to measure DNS resolution time

I am working on a python 3.6 based script to monitor dns resolution time, using dns python. I need to understand what is the best approach to get the resolution time. I am currently using the following: Method:1 import dns.resolver import…
She
  • 33
  • 4
3
votes
3 answers

Install dnspython on linux ubuntu

I have Ubuntu installed. I am trying to use zxlolbot. But when I open zxlolbot.py it gives me an error. Please download dnspython I tried to install dnspython but I couldn't install it. I don't use PuTTY.
Ilgın Yolgezen
  • 31
  • 1
  • 1
  • 3
3
votes
1 answer

sending DNS queries asynchronously with asyncio and dnspython

Say I want to send various types of DNS queries (A, AAAA, NS, SOA, DNSKEY, NSEC3, DS, etc) for Alexa top 1M sites using dnspython. Doing this one by one would take a bit long, since I'm sending multiple queries for each single site. So I wish to…
Eniaczz
  • 73
  • 2
  • 6
3
votes
1 answer

dnspython raises NoAnswer in spite of query answer

When I use dnspython to query an authoritative name server for NS records, it raises a NoAnswer exception, despite the fact that my packet capture shows that a proper response was received. Example: ask j.gtld-servers.net (192.48.79.30) for NS…
Mox
  • 571
  • 5
  • 14
2
votes
4 answers

dnspython and python objects

I'm trying to use the dnspython library, and am a little confused by their example for querying MX records on this page: www.dnspython.org/examples.html: import dns.resolver answers = dns.resolver.query('dnspython.org', 'MX') for rdata in answers: …
Victor Trac
  • 391
  • 1
  • 4
  • 13
2
votes
1 answer

DNSPython asynchronous resolve times out but synchronous resolve doesn't

I performed the tests on Python 3.9.7 x64, dnspython 2.1.0 and Windows 10 21H1. The problem is very simple: dns.resolver.Resolver() works normally but not dns.asyncresolver.Resolver(), they are supposed to have the same API, however while the former…
Ξένη Γήινος
  • 2,181
  • 1
  • 9
  • 35
2
votes
2 answers

Why is DNSPython zone transfer sporadically failing

So, I'm still at the noob level when it comes to python. I know... I know... there's probably a more efficient way to do what I'm trying but still learning and hopefully, I'll get better with practice. For a training project, I'm writing a script…
digital_alchemy
  • 663
  • 4
  • 9
  • 19
2
votes
1 answer

DNS Python Script to Modify Zone File(s) getting relativity error and inserting escape characters

Relatively new to python and programming in general but would like to automate a DNS migration I'm working on for a large # of domains. Shamelessly stole some initial framework from AgileTesting Blog. In it's current state the script fails to save…
Scott C
  • 23
  • 5
2
votes
2 answers

Delete specific dns record with dnspython when multiple are present

Consider following records in a dns server: ;; ANSWER SECTION: test.example.com 3600 IN TXT "line1" test.example.com 3600 IN TXT "line2" Is it possible to delete 1 of the records and leave the other one? When performing the…
2
votes
2 answers

Why is dnspython giving me this error?

Here is my simple code: print host for rdata in dns.resolver.query(host, 'CNAME') : prod_host = str(rdata.target) I'm pulling host out of a file. When I run this, I get the following: "www.maizena.es" Traceback (most recent call…
Ramy
  • 20,541
  • 41
  • 103
  • 153
2
votes
1 answer

dnspython dynamic update PeerBadKey

I'm working with dnspython attempting to perform updates against a BIND9 server, however I keep getting a Bad Key response (“tsig verify failure (BADKEY)”) - when I use nsupdate the key works just fine. Is there anyone who has successfully…
Vance84
  • 61
  • 5
2
votes
1 answer

dnspython dynamic TXT record update with spaces?

I have the following simple Python script utilising the dnspython library: import dns.query import dns.tsigkeyring import dns.update import dns.rdatatype import datetime import sys # Get data current_ip = '1.2.3.4' # Update DNS server keyring =…
Mark Embling
  • 12,605
  • 8
  • 39
  • 53