Script 'mail_helper' called by obssrc
Hello community,

here is the log from the commit of package dnsdiag for openSUSE:Factory checked 
in at 2023-02-08 17:20:37
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/dnsdiag (Old)
 and      /work/SRC/openSUSE:Factory/.dnsdiag.new.4462 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "dnsdiag"

Wed Feb  8 17:20:37 2023 rev:6 rq:1063763 version:2.1.0

Changes:
--------
--- /work/SRC/openSUSE:Factory/dnsdiag/dnsdiag.changes  2021-05-15 
23:17:31.800413983 +0200
+++ /work/SRC/openSUSE:Factory/.dnsdiag.new.4462/dnsdiag.changes        
2023-02-08 17:21:03.850170245 +0100
@@ -1,0 +2,9 @@
+Sat Feb  4 15:41:21 UTC 2023 - Martin Hauke <mar...@gmx.de>
+
+- Update to version 2.1.0
+  * Add -m flag to enforce cache-miss
+  * Add -r flag to clear RD flag (disable recursion)
+  * Remove support for python 3.4 - 3.6
+  * Other minor quality of life improvements
+
+-------------------------------------------------------------------

Old:
----
  dnsdiag-2.0.2.tar.gz

New:
----
  dnsdiag-2.1.0.tar.gz

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ dnsdiag.spec ++++++
--- /var/tmp/diff_new_pack.iHesgn/_old  2023-02-08 17:21:04.450173190 +0100
+++ /var/tmp/diff_new_pack.iHesgn/_new  2023-02-08 17:21:04.462173250 +0100
@@ -1,8 +1,8 @@
 #
 # spec file for package dnsdiag
 #
-# Copyright (c) 2021 SUSE LLC
-# Copyright (c) 2017-2021, Martin Hauke <mar...@gmx.de>
+# Copyright (c) 2023 SUSE LLC
+# Copyright (c) 2017-2023, Martin Hauke <mar...@gmx.de>
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -19,11 +19,12 @@
 
 %bcond_without test
 Name:           dnsdiag
-Version:        2.0.2
+Version:        2.1.0
 Release:        0
 Summary:        DNS request auditing toolset
 License:        BSD-3-Clause
 Group:          Development/Languages/Python
+#Git-Clone:     https://github.com/farrokhi/dnsdiag.git
 URL:            https://dnsdiag.org/
 Source:         
https://files.pythonhosted.org/packages/source/d/dnsdiag/dnsdiag-%{version}.tar.gz
 Source1:        dnseval.1
@@ -33,14 +34,12 @@
 BuildRequires:  python-rpm-macros
 BuildRequires:  python3-setuptools
 Requires:       python3-cymruwhois >= 1.6
-Requires:       python3-dnspython >= 1.15.0
+Requires:       python3-dnspython >= 2.3.0
 Requires:       python3-setuptools
-Provides:       python3-dnsdiag
-Obsoletes:      python3-dnsdiag
 BuildArch:      noarch
 %if %{with test}
 BuildRequires:  python3-cymruwhois >= 1.6
-BuildRequires:  python3-dnspython >= 1.15.0
+BuildRequires:  python3-dnspython >= 2.3.0
 %endif
 
 %description

++++++ dnsdiag-2.0.2.tar.gz -> dnsdiag-2.1.0.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/dnsdiag-2.0.2/PKG-INFO new/dnsdiag-2.1.0/PKG-INFO
--- old/dnsdiag-2.0.2/PKG-INFO  2021-05-13 13:49:19.896948300 +0200
+++ new/dnsdiag-2.1.0/PKG-INFO  2023-02-01 14:48:49.904830000 +0100
@@ -1,26 +1,16 @@
-Metadata-Version: 1.1
+Metadata-Version: 2.1
 Name: dnsdiag
-Version: 2.0.2
+Version: 2.1.0
 Summary: DNS Measurement, Troubleshooting and Security Auditing Toolset (ping, 
traceroute)
 Home-page: https://dnsdiag.org/
 Author: Babak Farrokhi
 Author-email: ba...@farrokhi.net
 License: BSD
-Description: 
-        DNSDiag provides a handful of tools to measure and diagnose your DNS
-        performance and integrity. Using dnsping, dnstraceroute and dnseval 
tools
-        you can measure your DNS response quality from delay and loss 
perspective
-        as well as tracing the path your DNS query takes to get to DNS server.
-        
 Keywords: dns traceroute ping performance
-Platform: UNKNOWN
 Classifier: Topic :: System :: Networking
 Classifier: Environment :: Console
 Classifier: Intended Audience :: Developers
 Classifier: License :: OSI Approved :: BSD License
-Classifier: Programming Language :: Python :: 3.4
-Classifier: Programming Language :: Python :: 3.5
-Classifier: Programming Language :: Python :: 3.6
 Classifier: Programming Language :: Python :: 3.7
 Classifier: Programming Language :: Python :: 3.8
 Classifier: Programming Language :: Python :: 3.9
@@ -28,3 +18,10 @@
 Classifier: Topic :: Internet :: Name Service (DNS)
 Classifier: Development Status :: 5 - Production/Stable
 Classifier: Operating System :: OS Independent
+License-File: LICENSE
+
+
+DNSDiag provides a handful of tools to measure and diagnose your DNS
+performance and integrity. Using dnsping, dnstraceroute and dnseval tools
+you can measure your DNS response quality from delay and loss perspective
+as well as tracing the path your DNS query takes to get to DNS server.
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/dnsdiag-2.0.2/README.md new/dnsdiag-2.1.0/README.md
--- old/dnsdiag-2.0.2/README.md 2021-04-03 21:14:04.000000000 +0200
+++ new/dnsdiag-2.1.0/README.md 2023-02-01 14:16:46.000000000 +0100
@@ -1,4 +1,4 @@
-[![Build 
Status](https://travis-ci.org/farrokhi/dnsdiag.svg)](https://travis-ci.org/farrokhi/dnsdiag)
 
[![PyPI](https://img.shields.io/pypi/v/dnsdiag.svg?maxAge=8600)](https://pypi.python.org/pypi/dnsdiag/)
 [![PyPI](https://img.shields.io/pypi/l/dnsdiag.svg?maxAge=8600)]() 
[![PyPI](https://img.shields.io/pypi/pyversions/dnsdiag.svg?maxAge=8600)]() 
[![Docker 
Pulls](https://img.shields.io/docker/pulls/farrokhi/dnsdiag)](https://hub.docker.com/r/farrokhi/dnsdiag)
 [![GitHub 
stars](https://img.shields.io/github/stars/farrokhi/dnsdiag.svg?style=social&label=Star&maxAge=8600)](https://github.com/farrokhi/dnsdiag/stargazers)
 
+[![Build 
Status](https://travis-ci.org/farrokhi/dnsdiag.svg)](https://travis-ci.org/farrokhi/dnsdiag)
 
[![PyPI](https://img.shields.io/pypi/v/dnsdiag.svg?maxAge=8600)](https://pypi.python.org/pypi/dnsdiag/)
 [![PyPI](https://img.shields.io/pypi/l/dnsdiag.svg?maxAge=8600)]() 
[![Downloads](https://static.pepy.tech/personalized-badge/dnsdiag?period=total&units=international_system&left_color=grey&right_color=blue&left_text=PyPi%20Downloads)](https://pepy.tech/project/dnsdiag)
 [![PyPI](https://img.shields.io/pypi/pyversions/dnsdiag.svg?maxAge=8600)]() 
[![Docker 
Pulls](https://img.shields.io/docker/pulls/farrokhi/dnsdiag)](https://hub.docker.com/r/farrokhi/dnsdiag)
 [![GitHub 
stars](https://img.shields.io/github/stars/farrokhi/dnsdiag.svg?style=social&label=Star&maxAge=8600)](https://github.com/farrokhi/dnsdiag/stargazers)
 
 
 DNS Measurement, Troubleshooting and Security Auditing Toolset
 ===============================================================
@@ -54,7 +54,7 @@
 If you don't want to install dnsdiags on your local machine, you may use the 
docker image and run programs in a container. For example:
 
 ```
-docker run -it --rm farrokhi/dnsdiag ./dnsping.py
+docker run --network host -it --rm farrokhi/dnsdiag dnsping.py
 ```
 
 # dnsping
@@ -67,18 +67,21 @@
 
 In addition to UDP, you can ping using TCP, DoT (DNS over TLS) and DoH (DNS 
over HTTPS) using `--tcp`, `--tls` and `--doh` respectively.
 
+```shell
+./dnsping.py -c 5 --dnssec --flags --tls -t AAAA -s 9.9.9.9 ripe.net
+```
+
 ```
-% ./dnsping.py -c 5 --dnssec --flags --tls -t AAAA -s 9.9.9.9 ripe.net
 dnsping.py DNS: 9.9.9.9:853, hostname: ripe.net, proto: TLS, rdatatype: AAAA, 
flags: RD
-233 bytes from 9.9.9.9: seq=1   time=186.202 ms [QR RD RA AD]
-233 bytes from 9.9.9.9: seq=2   time=191.233 ms [QR RD RA AD]
-233 bytes from 9.9.9.9: seq=3   time=105.455 ms [QR RD RA AD]
-233 bytes from 9.9.9.9: seq=4   time=111.053 ms [QR RD RA AD]
-233 bytes from 9.9.9.9: seq=5   time=110.329 ms [QR RD RA AD]
+169 bytes from 9.9.9.9: seq=1   time=279.805 ms [QR RD RA AD]  NOERROR
+169 bytes from 9.9.9.9: seq=2   time=107.237 ms [QR RD RA AD]  NOERROR
+169 bytes from 9.9.9.9: seq=3   time=96.747  ms [QR RD RA AD]  NOERROR
+169 bytes from 9.9.9.9: seq=4   time=107.782 ms [QR RD RA AD]  NOERROR
+169 bytes from 9.9.9.9: seq=5   time=94.713  ms [QR RD RA AD]  NOERROR
 
 --- 9.9.9.9 dnsping statistics ---
 5 requests transmitted, 5 responses received, 0% lost
-min=105.455 ms, avg=140.854 ms, max=191.233 ms, stddev=43.782 ms
+min=94.713 ms, avg=137.257 ms, max=279.805 ms, stddev=79.908 ms
 ```
 
 It also displays statistics such as minimum, maximum and average response time 
as well as
@@ -98,8 +101,11 @@
 
 In addition to UDP, it also supports TCP as transport protocol, using `--tcp` 
flag.
 
+```shell
+./dnstraceroute.py --expert --asn -C -t A -s 8.8.4.4 facebook.com
+```
+
 ```
-% ./dnstraceroute.py --expert --asn -C -t A -s 8.8.4.4 facebook.com
 dnstraceroute.py DNS: 8.8.4.4:53, hostname: facebook.com, rdatatype: A
 1      192.168.0.1 (192.168.0.1) 1 ms
 2      192.168.28.177 (192.168.28.177) 4 ms
@@ -123,8 +129,11 @@
 protocols such as UDP (default), TCP, DoT and DoH using `--tcp`, `--tls` and
 `--doh` respectively.
 
+```shell
+./dnseval.py --dnssec -t AAAA -f public-servers.txt -c10 ripe.net
+```
+
 ```
-% ./dnseval.py --dnssec -t AAAA -f public-servers.txt -c10 ripe.net
 server                   avg(ms)     min(ms)     max(ms)     stddev(ms)  
lost(%)  ttl        flags                  response
 
----------------------------------------------------------------------------------------------------------------------------
 1.0.0.1                  36.906      7.612       152.866     50.672      %0    
   300        QR -- -- RD RA AD --   NOERROR
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/dnsdiag-2.0.2/dnsdiag.egg-info/PKG-INFO 
new/dnsdiag-2.1.0/dnsdiag.egg-info/PKG-INFO
--- old/dnsdiag-2.0.2/dnsdiag.egg-info/PKG-INFO 2021-05-13 13:49:19.000000000 
+0200
+++ new/dnsdiag-2.1.0/dnsdiag.egg-info/PKG-INFO 2023-02-01 14:48:49.000000000 
+0100
@@ -1,26 +1,16 @@
-Metadata-Version: 1.1
+Metadata-Version: 2.1
 Name: dnsdiag
-Version: 2.0.2
+Version: 2.1.0
 Summary: DNS Measurement, Troubleshooting and Security Auditing Toolset (ping, 
traceroute)
 Home-page: https://dnsdiag.org/
 Author: Babak Farrokhi
 Author-email: ba...@farrokhi.net
 License: BSD
-Description: 
-        DNSDiag provides a handful of tools to measure and diagnose your DNS
-        performance and integrity. Using dnsping, dnstraceroute and dnseval 
tools
-        you can measure your DNS response quality from delay and loss 
perspective
-        as well as tracing the path your DNS query takes to get to DNS server.
-        
 Keywords: dns traceroute ping performance
-Platform: UNKNOWN
 Classifier: Topic :: System :: Networking
 Classifier: Environment :: Console
 Classifier: Intended Audience :: Developers
 Classifier: License :: OSI Approved :: BSD License
-Classifier: Programming Language :: Python :: 3.4
-Classifier: Programming Language :: Python :: 3.5
-Classifier: Programming Language :: Python :: 3.6
 Classifier: Programming Language :: Python :: 3.7
 Classifier: Programming Language :: Python :: 3.8
 Classifier: Programming Language :: Python :: 3.9
@@ -28,3 +18,10 @@
 Classifier: Topic :: Internet :: Name Service (DNS)
 Classifier: Development Status :: 5 - Production/Stable
 Classifier: Operating System :: OS Independent
+License-File: LICENSE
+
+
+DNSDiag provides a handful of tools to measure and diagnose your DNS
+performance and integrity. Using dnsping, dnstraceroute and dnseval tools
+you can measure your DNS response quality from delay and loss perspective
+as well as tracing the path your DNS query takes to get to DNS server.
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/dnsdiag-2.0.2/dnsdiag.egg-info/SOURCES.txt 
new/dnsdiag-2.1.0/dnsdiag.egg-info/SOURCES.txt
--- old/dnsdiag-2.0.2/dnsdiag.egg-info/SOURCES.txt      2021-05-13 
13:49:19.000000000 +0200
+++ new/dnsdiag-2.1.0/dnsdiag.egg-info/SOURCES.txt      2023-02-01 
14:48:49.000000000 +0100
@@ -16,4 +16,5 @@
 dnsdiag.egg-info/top_level.txt
 util/__init__.py
 util/dns.py
+util/shared.py
 util/whois.py
\ No newline at end of file
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/dnsdiag-2.0.2/dnsdiag.egg-info/entry_points.txt 
new/dnsdiag-2.1.0/dnsdiag.egg-info/entry_points.txt
--- old/dnsdiag-2.0.2/dnsdiag.egg-info/entry_points.txt 2021-05-13 
13:49:19.000000000 +0200
+++ new/dnsdiag-2.1.0/dnsdiag.egg-info/entry_points.txt 2023-02-01 
14:48:49.000000000 +0100
@@ -2,4 +2,3 @@
 dnseval = dnseval:main
 dnsping = dnsping:main
 dnstraceroute = dnstraceroute:main
-
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/dnsdiag-2.0.2/dnsdiag.egg-info/requires.txt 
new/dnsdiag-2.1.0/dnsdiag.egg-info/requires.txt
--- old/dnsdiag-2.0.2/dnsdiag.egg-info/requires.txt     2021-05-13 
13:49:19.000000000 +0200
+++ new/dnsdiag-2.1.0/dnsdiag.egg-info/requires.txt     2023-02-01 
14:48:49.000000000 +0100
@@ -1,4 +1,4 @@
-dnspython>=1.16.0
+dnspython>=2.3.0
 cymruwhois>=1.6
-requests>=2.21.0
+requests>=2.28.2
 requests-toolbelt>=0.9.1
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/dnsdiag-2.0.2/dnseval.py new/dnsdiag-2.1.0/dnseval.py
--- old/dnsdiag-2.0.2/dnseval.py        2021-05-13 13:42:12.000000000 +0200
+++ new/dnsdiag-2.1.0/dnseval.py        2023-02-01 13:35:46.000000000 +0100
@@ -1,6 +1,6 @@
 #!/usr/bin/env python3
 #
-# Copyright (c) 2016-2021, Babak Farrokhi
+# Copyright (c) 2016-2023, Babak Farrokhi
 # All rights reserved.
 #
 # Redistribution and use in source and binary forms, with or without
@@ -41,25 +41,10 @@
 
 __author__ = 'Babak Farrokhi (ba...@farrokhi.net)'
 __license__ = 'BSD'
-__version__ = '2.0.2'
 __progname__ = os.path.basename(sys.argv[0])
 
 from util.dns import PROTO_UDP, PROTO_TCP, PROTO_TLS, PROTO_HTTPS, 
setup_signal_handler, flags_to_text
-
-
-class Colors(object):
-    N = '\033[m'  # native
-    R = '\033[31m'  # red
-    G = '\033[32m'  # green
-    O = '\033[33m'  # orange
-    B = '\033[34m'  # blue
-
-    def __init__(self, mode):
-        if not mode:
-            self.N = ''
-            self.R = ''
-            self.G = ''
-            self.B = ''
+from util.shared import __version__, Colors
 
 
 def usage():
@@ -117,7 +102,7 @@
     try:
         opts, args = getopt.getopt(sys.argv[1:], "hf:c:t:w:S:TevCmXHDj:",
                                    ["help", "file=", "count=", "type=", 
"wait=", "json=", "tcp", "edns", "verbose",
-                                    "color", "force-miss", "srcip=", "tls", 
"doh", "dnssec"])
+                                    "color", "cache-miss", "srcip=", "tls", 
"doh", "dnssec"])
     except getopt.GetoptError as err:
         print(err)
         usage()
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/dnsdiag-2.0.2/dnsping.py new/dnsdiag-2.1.0/dnsping.py
--- old/dnsdiag-2.0.2/dnsping.py        2021-05-13 13:42:12.000000000 +0200
+++ new/dnsdiag-2.1.0/dnsping.py        2023-02-01 14:12:27.000000000 +0100
@@ -1,6 +1,6 @@
 #!/usr/bin/env python3
 #
-# Copyright (c) 2016-2021, Babak Farrokhi
+# Copyright (c) 2016-2023, Babak Farrokhi
 # All rights reserved.
 #
 # Redistribution and use in source and binary forms, with or without
@@ -29,7 +29,6 @@
 import getopt
 import ipaddress
 import os
-import requests
 import signal
 import socket
 import sys
@@ -38,12 +37,13 @@
 
 import dns.flags
 import dns.resolver
+import requests
 
-from util.dns import PROTO_UDP, PROTO_TCP, PROTO_TLS, PROTO_HTTPS, 
proto_to_text, unsupported_feature
+from util.dns import PROTO_UDP, PROTO_TCP, PROTO_TLS, PROTO_HTTPS, 
proto_to_text, unsupported_feature, random_string
+from util.shared import __version__
 
 __author__ = 'Babak Farrokhi (ba...@farrokhi.net)'
 __license__ = 'BSD'
-__version__ = '2.0.2'
 __progname__ = os.path.basename(sys.argv[0])
 shutdown = False
 
@@ -52,29 +52,39 @@
     print("""%s version %s
 usage: %s [-46DeFhqTvX] [-i interval] [-s server] [-p port] [-P port] [-S 
address] [-c count] [-t type] [-w wait] hostname
 
-  -h  --help      Show this help
-  -q  --quiet     Quiet
-  -v  --verbose   Print actual dns response
-  -s  --server    DNS server to use (default: first entry from 
/etc/resolv.conf)
-  -p  --port      DNS server port number (default: 53 for TCP/UDP and 853 for 
TLS)
-  -T  --tcp       Use TCP as transport protocol
-  -X  --tls       Use TLS as transport protocol
-  -H  --doh       Use HTTPS as transport protols (DoH)
-  -4  --ipv4      Use IPv4 as default network protocol
-  -6  --ipv6      Use IPv6 as default network protocol
-  -P  --srcport   Query source port number (default: 0)
-  -S  --srcip     Query source IP address (default: default interface address)
-  -c  --count     Number of requests to send (default: 10, 0 for infinity)
-  -w  --wait      Maximum wait time for a reply (default: 2 seconds)
-  -i  --interval  Time between each request (default: 1 seconds)
-  -t  --type      DNS request record type (default: A)
-  -e  --edns      Disable EDNS0 (default: Enabled)
-  -D  --dnssec    Enable 'DNSSEC desired' flag in requests. Implies EDNS.
-  -F  --flags     Display response flags
+  -h  --help        Show this help
+  -q  --quiet       Quiet
+  -v  --verbose     Print actual dns response
+  -s  --server      DNS server to use (default: first entry from 
/etc/resolv.conf)
+  -p  --port        DNS server port number (default: 53 for TCP/UDP and 853 
for TLS)
+  -T  --tcp         Use TCP as transport protocol
+  -X  --tls         Use TLS as transport protocol
+  -H  --doh         Use HTTPS as transport protols (DoH)
+  -4  --ipv4        Use IPv4 as default network protocol
+  -6  --ipv6        Use IPv6 as default network protocol
+  -P  --srcport     Query source port number (default: 0)
+  -S  --srcip       Query source IP address (default: default interface 
address)
+  -c  --count       Number of requests to send (default: 10, 0 for infinity)
+  -r  --norecurse   Enforce non-recursive query by clearing the RD (recursion 
desired) bit in the query
+  -m  --cache-miss  Force cache miss measurement by prepending a random 
hostname
+  -w  --wait        Maximum wait time for a reply (default: 2 seconds)
+  -i  --interval    Time between each request (default: 1 seconds)
+  -t  --type        DNS request record type (default: A)
+  -e  --edns        Disable EDNS0 (default: Enabled)
+  -D  --dnssec      Enable 'DNSSEC desired' flag in requests. Implies EDNS.
+  -F  --flags       Display response flags
 """ % (__progname__, __version__, __progname__))
     sys.exit(0)
 
 
+def setup_signal_handler():
+    try:
+        signal.signal(signal.SIGTSTP, signal.SIG_IGN)  # ignore CTRL+Z
+        signal.signal(signal.SIGINT, signal_handler)  # custom CTRL+C handler
+    except AttributeError:  # not all signals are supported on all platforms
+        pass
+
+
 def signal_handler(sig, frame):
     global shutdown
     if shutdown:  # pressed twice, so exit immediately
@@ -82,12 +92,22 @@
     shutdown = True  # pressed once, exit gracefully
 
 
-def main():
+def validate_server_address(dnsserver, address_family):
+    """checks if we have a valid dns server address and resolve if it is a 
hostname"""
+
     try:
-        signal.signal(signal.SIGTSTP, signal.SIG_IGN)  # ignore CTRL+Z
-        signal.signal(signal.SIGINT, signal_handler)  # custom CTRL+C handler
-    except AttributeError:  # OS Does not support some signals, probably 
windows
-        pass
+        ipaddress.ip_address(dnsserver)
+    except ValueError:  # so it is not a valid IPv4 or IPv6 address, so try to 
resolve host name
+        try:
+            dnsserver = socket.getaddrinfo(dnsserver, port=None, 
family=address_family)[1][4][0]
+        except OSError:
+            print('Error: cannot resolve hostname:', dnsserver, 
file=sys.stderr, flush=True)
+            sys.exit(1)
+    return dnsserver
+
+
+def main():
+    setup_signal_handler()
 
     if len(sys.argv) == 1:
         usage()
@@ -107,14 +127,16 @@
     proto = PROTO_UDP
     use_edns = True
     want_dnssec = False
+    force_miss = False
+    request_flags = dns.flags.from_text('RD')
     af = socket.AF_INET
     qname = 'wikipedia.org'
 
     try:
-        opts, args = getopt.getopt(sys.argv[1:], "qhc:s:t:w:i:vp:P:S:T46eDFXH",
+        opts, args = getopt.getopt(sys.argv[1:], 
"qhc:s:t:w:i:vp:P:S:T46meDFXHr",
                                    ["help", "count=", "server=", "quiet", 
"type=", "wait=", "interval=", "verbose",
-                                    "port=", "srcip=", "tcp", "ipv4", "ipv6", 
"srcport=", "edns", "dnssec", "flags",
-                                    "tls", "doh"])
+                                    "port=", "srcip=", "tcp", "ipv4", "ipv6", 
"cache-miss", "srcport=", "edns",
+                                    "dnssec", "flags", "norecurse", "tls", 
"doh"])
     except getopt.GetoptError as err:
         # print help information and exit:
         print(err, file=sys.stderr)  # will print something like "option -a 
not recognized"
@@ -139,8 +161,10 @@
             verbose = False
         elif o in ("-w", "--wait"):
             timeout = int(a)
+        elif o in ("-m", "--cache-miss"):
+            force_miss = True
         elif o in ("-i", "--interval"):
-            interval = int(a)
+            interval = float(a)
         elif o in ("-t", "--type"):
             rdatatype = a
         elif o in ("-T", "--tcp"):
@@ -157,6 +181,8 @@
             af = socket.AF_INET6
         elif o in ("-e", "--edns"):
             use_edns = False
+        elif o in ("-r", "--norecurse"):
+            request_flags = dns.flags.from_text('')
         elif o in ("-D", "--dnssec"):
             want_dnssec = True
         elif o in ("-F", "--flags"):
@@ -177,30 +203,14 @@
     if dnsserver is None:
         dnsserver = dns.resolver.get_default_resolver().nameservers[0]
 
-    # check if we have a valid dns server address
-    try:
-        ipaddress.ip_address(dnsserver)
-    except ValueError:  # so it is not a valid IPv4 or IPv6 address, so try to 
resolve host name
-        try:
-            dnsserver = socket.getaddrinfo(dnsserver, port=None, 
family=af)[1][4][0]
-        except OSError:
-            print('Error: cannot resolve hostname:', dnsserver, 
file=sys.stderr, flush=True)
-            sys.exit(1)
-
-    if use_edns:
-        query = dns.message.make_query(qname, rdatatype, dns.rdataclass.IN,
-                                       use_edns=True, want_dnssec=want_dnssec,
-                                       
ednsflags=dns.flags.edns_from_text('DO'), payload=8192)
-    else:
-        query = dns.message.make_query(qname, rdatatype, dns.rdataclass.IN,
-                                       use_edns=False, want_dnssec=want_dnssec)
+    dnsserver = validate_server_address(dnsserver, af)
 
     response_time = []
     i = 0
 
     print("%s DNS: %s:%d, hostname: %s, proto: %s, rdatatype: %s, flags: %s" %
           (__progname__, dnsserver, dst_port, qname, proto_to_text(proto), 
rdatatype,
-           dns.flags.to_text(query.flags)), flush=True)
+           dns.flags.to_text(request_flags)), flush=True)
 
     while not shutdown:
 
@@ -209,6 +219,19 @@
         else:
             i += 1
 
+        if force_miss:
+            fqdn = "_dnsdiag_%s_.%s" % (random_string(8, 8), qname)
+        else:
+            fqdn = qname
+
+        if use_edns:
+            query = dns.message.make_query(fqdn, rdatatype, dns.rdataclass.IN, 
flags=request_flags,
+                                           use_edns=True, 
want_dnssec=want_dnssec,
+                                           ednsflags=dns.flags.EDNSFlag.DO, 
payload=8192)
+        else:
+            query = dns.message.make_query(fqdn, rdatatype, dns.rdataclass.IN, 
flags=request_flags,
+                                           use_edns=False, 
want_dnssec=want_dnssec)
+
         try:
             stime = time.perf_counter()
             if proto is PROTO_UDP:
@@ -261,7 +284,7 @@
                     flags = " [%s]  %s" % (dns.flags.to_text(answers.flags), 
dns.rcode.to_text(answers.rcode()))
                 else:
                     flags = ""
-                print("%d bytes from %s: seq=%-3d time=%.3f ms%s" % (
+                print("%d bytes from %s: seq=%-3d time=%-7.3f ms%s" % (
                     len(answers.to_wire()), dnsserver, i, elapsed, flags), 
flush=True)
             if verbose:
                 print(answers.to_text(), flush=True)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/dnsdiag-2.0.2/dnstraceroute.py 
new/dnsdiag-2.1.0/dnstraceroute.py
--- old/dnsdiag-2.0.2/dnstraceroute.py  2021-05-13 13:42:12.000000000 +0200
+++ new/dnsdiag-2.1.0/dnstraceroute.py  2023-02-01 13:35:46.000000000 +0100
@@ -1,6 +1,6 @@
 #!/usr/bin/env python3
 #
-# Copyright (c) 2016-2021, Babak Farrokhi
+# Copyright (c) 2016-2023, Babak Farrokhi
 # All rights reserved.
 #
 # Redistribution and use in source and binary forms, with or without
@@ -39,6 +39,7 @@
 
 import util.whois
 from util.dns import PROTO_UDP, PROTO_TCP, setup_signal_handler
+from util.shared import __version__, Colors
 
 # Global Variables
 quiet = False
@@ -47,7 +48,6 @@
 # Constants
 __author__ = 'Babak Farrokhi (ba...@farrokhi.net)'
 __license__ = 'BSD'
-__version__ = '2.0.2'
 __progname__ = os.path.basename(sys.argv[0])
 
 
@@ -56,26 +56,12 @@
     pass
 
 
-class Colors(object):
-    N = '\033[m'  # native
-    R = '\033[31m'  # red
-    G = '\033[32m'  # green
-    B = '\033[34m'  # blue
-
-    def __init__(self, mode):
-        if not mode:
-            self.N = ''
-            self.R = ''
-            self.G = ''
-            self.B = ''
-
-
 def usage():
     print("""%s version %s
 usage: %s [-aeqhCx] [-s server] [-p port] [-c count] [-t type] [-w wait]  
hostname
 
   -h  --help      Show this help
-  -q  --quiet     Quiet
+  -q  --quiet     Quiet mode: No extra information, only traceroute output.
   -T  --tcp       Use TCP as transport protocol
   -x  --expert    Print expert hints if available
   -a  --asn       Turn on AS# lookups for each hop encountered
@@ -291,6 +277,7 @@
         else:
             elapsed = abs(etime - stime) * 1000  # convert to milliseconds
 
+        curr_name = curr_addr
         if should_resolve:
             try:
                 if curr_addr:
@@ -301,8 +288,6 @@
                 pass
             except Exception:
                 print("unxpected error: ", sys.exc_info()[0])
-        else:
-            curr_name = curr_addr
 
         global whois_cache
         if curr_addr:
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/dnsdiag-2.0.2/setup.py new/dnsdiag-2.1.0/setup.py
--- old/dnsdiag-2.0.2/setup.py  2021-05-13 13:42:12.000000000 +0200
+++ new/dnsdiag-2.1.0/setup.py  2023-02-01 13:44:12.000000000 +0100
@@ -1,20 +1,18 @@
 from setuptools import setup, find_packages
+from util.shared import __version__
 
 setup(
     name="dnsdiag",
-    version="2.0.2",
+    version=__version__,
     packages=find_packages(),
     scripts=["dnseval.py", "dnsping.py", "dnstraceroute.py"],
-    install_requires=['dnspython>=1.16.0', 'cymruwhois>=1.6', 
'requests>=2.21.0', 'requests-toolbelt>=0.9.1'],
+    install_requires=['dnspython>=2.3.0', 'cymruwhois>=1.6', 
'requests>=2.28.2', 'requests-toolbelt>=0.9.1'],
 
     classifiers=[
         "Topic :: System :: Networking",
         "Environment :: Console",
         "Intended Audience :: Developers",
         "License :: OSI Approved :: BSD License",
-        "Programming Language :: Python :: 3.4",
-        "Programming Language :: Python :: 3.5",
-        "Programming Language :: Python :: 3.6",
         "Programming Language :: Python :: 3.7",
         "Programming Language :: Python :: 3.8",
         "Programming Language :: Python :: 3.9",
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/dnsdiag-2.0.2/util/dns.py 
new/dnsdiag-2.1.0/util/dns.py
--- old/dnsdiag-2.0.2/util/dns.py       2021-05-13 11:17:22.000000000 +0200
+++ new/dnsdiag-2.1.0/util/dns.py       2023-02-01 13:36:24.000000000 +0100
@@ -1,6 +1,6 @@
 #!/usr/bin/env python3
 #
-# Copyright (c) 2016-2021, Babak Farrokhi
+# Copyright (c) 2016-2023, Babak Farrokhi
 # All rights reserved.
 #
 # Redistribution and use in source and binary forms, with or without
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/dnsdiag-2.0.2/util/shared.py 
new/dnsdiag-2.1.0/util/shared.py
--- old/dnsdiag-2.0.2/util/shared.py    1970-01-01 01:00:00.000000000 +0100
+++ new/dnsdiag-2.1.0/util/shared.py    2023-02-01 13:36:24.000000000 +0100
@@ -0,0 +1,44 @@
+#!/usr/bin/env python3
+#
+# Copyright (c) 2016-2023, Babak Farrokhi
+# All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions are met:
+#
+# * Redistributions of source code must retain the above copyright notice, this
+#   list of conditions and the following disclaimer.
+#
+# * Redistributions in binary form must reproduce the above copyright notice,
+#   this list of conditions and the following disclaimer in the documentation
+#   and/or other materials provided with the distribution.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 
ARE
+# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
+# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+__version__ = '2.1.0'
+
+
+class Colors(object):
+    N = '\033[m'  # native
+    R = '\033[31m'  # red
+    G = '\033[32m'  # green
+    O = '\033[33m'  # orange
+    B = '\033[34m'  # blue
+
+    def __init__(self, mode):
+        if not mode:
+            self.N = ''
+            self.R = ''
+            self.G = ''
+            self.O = ''
+            self.B = ''
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/dnsdiag-2.0.2/util/whois.py 
new/dnsdiag-2.1.0/util/whois.py
--- old/dnsdiag-2.0.2/util/whois.py     2021-04-05 15:48:37.000000000 +0200
+++ new/dnsdiag-2.1.0/util/whois.py     2023-02-01 13:36:24.000000000 +0100
@@ -1,6 +1,6 @@
 #!/usr/bin/env python3
 #
-# Copyright (c) 2016-2021, Babak Farrokhi
+# Copyright (c) 2016-2023, Babak Farrokhi
 # All rights reserved.
 #
 # Redistribution and use in source and binary forms, with or without

Reply via email to