File: testsrv.py

package info (click to toggle)
py3dns 3.0.2-1%2Bdeb7u2
  • links: PTS, VCS
  • area: main
  • in suites: wheezy
  • size: 244 kB
  • sloc: python: 1,587; makefile: 10
file content (13 lines) | stat: -rwxr-xr-x 282 bytes parent folder | download | duplicates (7)
1
2
3
4
5
6
7
8
9
10
11
12
13
#!/usr/bin/python3

import sys ; sys.path.insert(0, '..')

import DNS
# automatically load nameserver(s) from /etc/resolv.conf
# (works on unix - on others, YMMV)
DNS.ParseResolvConf()

r=DNS.Request(qtype='srv')
res = r.req('_ldap._tcp.openldap.org')
res.show()
print(res.answers)