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
1
vote
3 answers

How to add reverse IP record by using DNSPython

I try to add DNS record by using DNSPython; it works well when I set dns like this: import dns.resolver import dns.query import dns.reversename import dns.update import dns.rdatatype update = dns.update.Update('test.com') update.replace('a', 3600,…
Karon
  • 41
  • 1
  • 5
1
vote
0 answers

'dns.rdtypes.*' and 'dns.rdtypes.ANY.*' hook not found when using pyinstaller + dnspython

I am using Python 3.4, PyInstaller (3.0) and dnspython3 (1.12.0). My script runs fine from dns import resolver,reversename try: host_IP = resolver.query('www.google.ca', 'A') print(host_IP[0]) except: print('Not found !!') try: …
BrianB
  • 11
  • 3
1
vote
0 answers

How can i change TTL of DNS packet created using dns python?

The idea is to send DNS packet with increasing TTL so as to find out if intermediate node has sent reply or not. So i want to send DNS packet multiple time with increasing TTL. How to change TTL of packet while sending it. I am using dns python to…
Arpit
  • 23
  • 3
1
vote
1 answer

Query reverse dns lookups with dnspython

I am trying to query reverse lookups in dnspython. Unfortunately, the from_address() function does not let me hand over a IP by variable. Any ideas why? #!/usr/bin/env python import dns.resolver,dns.reversename with open("test", "r") as ips: …
Simon
  • 11
  • 1
  • 4
1
vote
3 answers

ImportError: No module named dns.exception

I am trying to use the dnspython in my code but when it gets to the import statement, I get the following error: >>> import DNS.resolver Traceback (most recent call last): File "", line 1, in File…
TomSelleck
  • 6,706
  • 22
  • 82
  • 151
1
vote
1 answer

Read zone file with dnspython SOA error

I am really battling to get dnspython to read a zone file, I always get stuck with SOA and I have tried combinations of different zones files and python scripts. Zone file(From…
Gregg
  • 235
  • 1
  • 6
  • 13
1
vote
0 answers

How do I use dnspython to query for a host pattern

Let us say that I want to count the number of hosts that match a simple pattern. For example: host1.example.com host2.example.com ... host42.example.com where I don't know ahead of time that there are 42 of these. What I would like to do is…
coyot
  • 418
  • 1
  • 3
  • 12
1
vote
2 answers

how to trigger a zone file save from dnspython after an update

I am using dnspython to perform dynamic DNS updates using a syntax similar to: import dns.update, dns.query update = dns.update.Update('zone', keyring=keyring) update.add('source', 60, 'CNAME', 'destination') response = dns.query.tcp(update,…
Gman
  • 63
  • 1
  • 8
0
votes
2 answers

how do I generate dns wire format

I am trying to understand the DNS wire format used in DNS over HTTP: ref: https://developers.cloudflare.com/1.1.1.1/encryption/dns-over-https/make-api-requests/dns-wireformat/ This page mentions the query for www.example.com: curl -D - -X GET -H…
Bhakta Raghavan
  • 664
  • 6
  • 16
0
votes
0 answers

I use dig and dnspython to make DOH query, dig succeed but why dnspython fail?

The dig is a tool on linux to make dns query, and dnspython is a python packet to make dns query. I want to make DOH query and I have tried these two ways. When I use dig, I succeed, but when I use dnspython, I fail. 1. Environment initialization I…
0
votes
0 answers

AttributeError: module 'httpcore' has no attribute 'CloseError'

import dns import dns.resolver result = dns.resolver.query('tutorialspoint.com', 'A') for ipval in result: print('IP', ipval.to_text()) This is my code, and i am getting an error in 'httpcore' as, AttributeError: module 'httpcore' has no…
0
votes
1 answer

How to solve the ImportError: cannot import name 'MutableMapping' from 'collections' in Python

I was connecting the Python to mongoDB cluster. But I got the error message 'importError: cannot import name 'MutableMapping' from 'collections' in Python. I want to know how to solve this problem. Here is my code from pymongo import…
camilla
  • 21
  • 1
0
votes
0 answers

dnspython PTR query podman DNS

i wonder if anyone with a keen eye can help me. It appears podman adds multiple PTR records which prevents stops me from using socket.gethostbyaddr as it only returns the last answer in alpine. I decided to try dnspython, however, i cannot seem to…
MarkM
  • 33
  • 3
0
votes
0 answers

dnspython zone transfer fails

I try to start a zone transfer with dnspython for the whole .ch domain (https://www.switch.ch/open-data/#tab-c5442a19-67cf-11e8-9cf6-5254009dc73c-3). This needs a tsig key, which can be passed to dnspython. But somehow I seem to be doing it wrong,…
Syrius
  • 941
  • 6
  • 22
0
votes
0 answers

What's the best way to scale millions of DNS queries.. (Python)

Consequently, I initially intended to write this in Python, but I am completely open to writing it in any language. I'm working with the Alexa top 1 million right now, and I want to find out how many of these domains have DMARC enabled. To obtain…