File: test6.py

package info (click to toggle)
py3dns 4.0.2-4
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 360 kB
  • sloc: python: 1,984; makefile: 10; sh: 7
file content (28 lines) | stat: -rwxr-xr-x 1,120 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#!/usr/bin/python3

import sys ; sys.path.insert(0, '..')
import DNS
req = DNS.DnsRequest('mailout03.controlledmail.com', qtype='AAAA', protocol='tcp')
resp = req.req()
print(resp.answers[0]['name'], resp.answers[0]['data'])

req1 = DNS.DnsRequest('mailout03.controlledmail.com', qtype='AAAA', protocol='udp')
resp1 = req1.req(resulttype='binary')
print(resp1.answers[0]['name'], resp1.answers[0]['data'])

req2 = DNS.DnsRequest('mailout03.controlledmail.com', qtype='AAAA', protocol='tcp')
resp2 = req2.req(resulttype='text')
print(resp2.answers[0]['name'], resp2.answers[0]['data'])

req3 = DNS.DnsRequest('mailout03.controlledmail.com', qtype='A', protocol='tcp')
resp3 = req3.req()
print(resp3.answers[0]['name'], resp3.answers[0]['data'])

req4 = DNS.DnsRequest('mailout03.controlledmail.com', qtype='A', protocol='udp', resulttype='binary')
resp4 = req4.req(resulttype='binary')
print(resp4.answers[0]['name'], resp4.answers[0]['data'])

req5 = DNS.DnsRequest('mailout03.controlledmail.com', qtype='A', protocol='tcp')
resp5 = req5.req(resulttype='text')
print(resp5.answers[0]['name'], resp5.answers[0]['data'])