2 # ldd - DNS implementation in Python
3 # Copyright (C) 2006 Fredrik Tolf <fredrik@dolda2000.com>
5 # This program is free software; you can redistribute it and/or modify
6 # it under the terms of the GNU General Public License as published by
7 # the Free Software Foundation; either version 2 of the License, or
8 # (at your option) any later version.
10 # This program is distributed in the hope that it will be useful,
11 # but WITHOUT ANY WARRANTY; without even the implied warranty of
12 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 # GNU General Public License for more details.
15 # You should have received a copy of the GNU General Public License
16 # along with this program; if not, write to the Free Software
17 # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
25 from ldd import resolver
27 nameserver = (socket.AF_INET, "198.41.0.4", 53)
32 opts, args = getopt.getopt(sys.argv[1:], "vrRs:t:p:")
36 nameserver = (socket.AF_INET, a, 53)
43 nameserver = nameserver[0:2] + (int(a),)
52 print "No target given"
55 res = resolver.resolver(nameserver, lrec, srec, verbose = verbose)
57 rsp = res.squery(args[0], rtype)
58 except resolver.error, inst:
59 print "error: " + str(inst)
60 except KeyboardInterrupt: