How to debug intermittent name resolution failures on a Debian Stretch machine?

When it does not work:
% dig +trace github.com

; <<>> DiG 9.10.3-P4-Debian <<>> +trace github.com
;; global options: +cmd
;; connection timed out; no servers could be reached

When it works
% dig +trace github.com

; <<>> DiG 9.10.3-P4-Debian <<>> +trace github.com
;; global options: +cmd
.                       139521  IN      NS      g.root-servers.net.
.                       139521  IN      NS      f.root-servers.net.
.                       139521  IN      NS      c.root-servers.net.
.                       139521  IN      NS      d.root-servers.net.
.                       139521  IN      NS      j.root-servers.net.
.                       139521  IN      NS      m.root-servers.net.
.                       139521  IN      NS      i.root-servers.net.
.                       139521  IN      NS      e.root-servers.net.
.                       139521  IN      NS      k.root-servers.net.
.                       139521  IN      NS      l.root-servers.net.
.                       139521  IN      NS      h.root-servers.net.
.                       139521  IN      NS      a.root-servers.net.
.                       139521  IN      NS      b.root-servers.net.
.                       139521  IN      RRSIG   NS 8 0 518400
20190108050000 20181226040000 2134 .
FRQBGgylQysK4zZxEMLZPGakdSzurTVRPYbxqNMUOx/PgD6k6sCIQF1X
Wy+VfUunSSrcI5zOA1uZYK+3Aji8dRqbXGZX/queVWSO3fa8+I5OjNHb
SF44MNhHyw2+brYhc2ilM9LayT+KFDjIOwtx2ZOSem4XpBQoYqoJIUso
FEsqEYrNEkCNdWEHaEZS+zbt9lScf1JPNGHcN/ySyVP0z2PEO3ciS5o8
lbhwtJvhkDCYtpMmZHkqpjZRWTIB+oONAS+Z6uVhujDHBVi8WU/uuGnL
uduqu361+Z7bmQW+SpQ+qjkpZTbiwDlvx75PzHT0O5Ip0Vtnpvc9tMFr q4ShtA==
;; Received 525 bytes from 8.8.8.8#53(8.8.8.8) in 11 ms

com.                    172800  IN      NS      a.gtld-servers.net.
com.                    172800  IN      NS      b.gtld-servers.net.
com.                    172800  IN      NS      c.gtld-servers.net.
com.                    172800  IN      NS      d.gtld-servers.net.
com.                    172800  IN      NS      e.gtld-servers.net.
com.                    172800  IN      NS      f.gtld-servers.net.
com.                    172800  IN      NS      g.gtld-servers.net.
com.                    172800  IN      NS      h.gtld-servers.net.
com.                    172800  IN      NS      i.gtld-servers.net.
com.                    172800  IN      NS      j.gtld-servers.net.
com.                    172800  IN      NS      k.gtld-servers.net.
com.                    172800  IN      NS      l.gtld-servers.net.
com.                    172800  IN      NS      m.gtld-servers.net.
com.                    86400   IN      DS      30909 8 2
E2D3C916F6DEEAC73294E8268FB5885044A833FC5459588F4A9184CF C41A5766
com.                    86400   IN      RRSIG   DS 8 1 86400
20190109190000 20181227180000 2134 .
VIX0wchjf73XwDh8x23kN2KTC0FxlPu0tEfNwpszCSvtf31FnvVdi8cx
Jp8/GigmCX/vX3iytRZQtjM/SbZYDc9dQLr628IP6bEDG0iTzKZyYuuk
ehoEYuIGKVZvPbQYxLtDK2dRZSbU88YcwJXVzpwLifc4vpZkvidq6PHM
QXAnIayiejL5cxrfPWhei1tyW4OX1rTBQvtZ7CQ8Bd3GR3RAMwqZdDK4
vPdfHDv+NgNVOvP2+8+7LYMRUkl3+BfZvnLMbmM1wxn/kJ/tNmfdUKih
jnyIziZX15MnrDpa4fiLyTpE351TO2ZNwXmddcGFHbmguaNCxZk6GSTj 1ANl5Q==
;; Received 1170 bytes from 199.7.83.42#53(l.root-servers.net) in 78 ms

github.com.             172800  IN      NS      ns1.p16.dynect.net.
github.com.             172800  IN      NS      ns3.p16.dynect.net.
github.com.             172800  IN      NS      ns2.p16.dynect.net.
github.com.             172800  IN      NS      ns4.p16.dynect.net.
github.com.             172800  IN      NS      ns-520.awsdns-01.net.
github.com.             172800  IN      NS      ns-421.awsdns-52.com.
github.com.             172800  IN      NS      ns-1707.awsdns-21.co.uk.
github.com.             172800  IN      NS      ns-1283.awsdns-32.org.
CK0POJMG874LJREF7EFN8430QVIT8BSM.com. 86400 IN NSEC3 1 1 0 -
CK0Q1GIN43N1ARRC9OSM6QPQR81H5M9A NS SOA RRSIG DNSKEY NSEC3PARAM
CK0POJMG874LJREF7EFN8430QVIT8BSM.com. 86400 IN RRSIG NSEC3 8 2 86400
20190103054632 20181227043632 37490 com.
KdNZS7+gu74UyGr9N/WHOjxGk6lc5i8ENAJQfBEoWUVHWUyimNDVwhXf
kWLP5KFYrtTD3ttkUZqi2SKHa342XgS0+ZuxYqomAXY8lZyDEvySKKY+
09quOmPHqrv6PCo+mRsrR6wOHqiTD8G2E+wvxIUvZq/6WuliibnvVPLp SDg=
4KB3QDAGSO6KO9JK2O5F2FO8F4C5FTA2.com. 86400 IN NSEC3 1 1 0 -
4KB4PTQQ5CTA7POCTGM7RUFC8B1RKTEU NS DS RRSIG
4KB3QDAGSO6KO9JK2O5F2FO8F4C5FTA2.com. 86400 IN RRSIG NSEC3 8 2 86400
20181231051755 20181224040755 37490 com.
RidH3Du0PQ8UJTkN4iKk3pI/iShNZywXuFeihaf4smZF8A4xQ29jfFeh
ADpk5peLKDOBGjML0rLQlgB8u8+bMLRLBsBX9lEk6id159AQ+3kvnCXT
2Ds4FXJitUd2QtBw/BAiVzeVkLAKUL92yy73gZtn7el82r/YhNfHsJin YiU=
;; Received 840 bytes from 192.5.6.30#53(a.gtld-servers.net) in 199 ms

github.com.             60      IN      A       192.30.253.113
github.com.             60      IN      A       192.30.253.112
github.com.             900     IN      NS      ns1.p16.dynect.net.
github.com.             900     IN      NS      ns-421.awsdns-52.com.
github.com.             900     IN      NS      ns-1283.awsdns-32.org.
github.com.             900     IN      NS      ns4.p16.dynect.net.
github.com.             900     IN      NS      ns-520.awsdns-01.net.
github.com.             900     IN      NS      ns3.p16.dynect.net.
github.com.             900     IN      NS      ns2.p16.dynect.net.
github.com.             900     IN      NS      ns-1707.awsdns-21.co.uk.
;; Received 291 bytes from 204.13.250.16#53(ns2.p16.dynect.net) in 9 ms


Machine configuration:

% cat /etc/hosts
127.0.0.1       localhost
::1     localhost       ip6-localhost   ip6-loopback
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters

127.0.1.1       mercury.localdomain     mercury

% cat /etc/nsswitch.conf
# /etc/nsswitch.conf
#
# Example configuration of GNU Name Service Switch functionality.
# If you have the `glibc-doc-reference' and `info' packages installed, try:
# `info libc "Name Service Switch"' for information about this file.

passwd:         compat
group:          compat
shadow:         compat
gshadow:        files

hosts:          files dns
networks:       files

protocols:      db files
services:       db files
ethers:         db files
rpc:            db files

netgroup:       nis

% uname -a
Linux mercury 4.9.0-8-amd64 #1 SMP Debian 4.9.130-2 (2018-10-27)
x86_64 GNU/Linux

% cat /etc/resolv.conf
nameserver 8.8.8.8
nameserver 8.8.4.4

Any ideas/suggestions/comments on how to debug this?

thanks
raju

--
Kamaraju S Kusumanchi | http://raju.shoutwiki.com/wiki/Blog

Reply via email to