Skip to content

"none of the user-supplied local addresses ([X.X.X.X]) could connect to name server 127.0.0.1:53" (--iterative --local-addr) #593

@cpack299

Description

@cpack299

Describe the bug
zdns crashes with the following FATAL error when using --iterative and --local-addr when looking up the NS records for the domain snowplowingandremoval.com

FATA[0000] none of the user-supplied local addresses ([X.X.X.X]) could connect to name server 127.0.0.1:53

Trying to decipher by the log: seems like 127.0.0.1 is returned as an A record result but zdns cannot access and cache it since it is bound to a local interface that can't access 127.0.0.1 (maybe?).

To Reproduce
zdns version 2.0.4
Substitute --local-addr=10.134.52.42 with the IP address of any local interface that is not the loopback device.

echo "snowplowingandremoval.com" > domains.txt
echo "192.41.162.30" > resolvers.txt
zdns --verbosity=5 --name-servers=resolvers.txt --iterative --go-processes=4 --threads=500 --retries=0 --local-addr=10.134.52.42 --output-file=domains.json  --input-file=domains.txt NS

Output:

INFO[0000] using local addresses: [10.134.52.42]        
INFO[0000] for non-iterative lookups, using external nameservers: 192.41.162.30:53 
INFO[0000] for iterative lookups, using nameservers: 192.41.162.30:53 
DEBU[0000] DEPTH 00:[MIEKG-IN: starting a C/DNAME following lookup for  snowplowingandremoval.com  ( 2 )] 
DEBU[0000] DEPTH 01:    [MIEKG-IN: following iterative lookup for  snowplowingandremoval.com  ( 2 )] 
DEBU[0000] DEPTH 02:        [Cached retrying lookup. Name:  {2 1 snowplowingandremoval.com} , Layer:  . , Nameserver:  192.41.162.30:53] 
DEBU[0000] DEPTH 03:            [Cache request for:  snowplowingandremoval.com  ( 2 )] 
DEBU[0000] DEPTH 04:                [-> no entry found in cache for  snowplowingandremoval.com] 
DEBU[0000] DEPTH 03:            [Cache auth check for  com] 
DEBU[0000] DEPTH 04:                [Cache authority request for:  com  ( 2 )] 
DEBU[0000] DEPTH 05:                    [-> no entry found in cache for  com] 
DEBU[0000] DEPTH 03:            [Cache miss for  {2 1 snowplowingandremoval.com} , Layer:  . , Nameserver:  192.41.162.30:53  going to the wire in retryingLookup] 
DEBU[0000] DEPTH 01:    [****WIRE LOOKUP***  udp   NS   snowplowingandremoval.com   192.41.162.30:53] 
DEBU[0000] DEPTH 03:            [Results from wire for name:  {2 1 snowplowingandremoval.com} , Layer:  . , Nameserver:  192.41.162.30:53  status:  NOERROR  , err:  <nil>  result:  {[] [{EDNS0 0  4096 <nil> <nil> <nil> <nil> <nil> <nil> <nil> <nil> <nil> <nil> <nil> []}] [{172800 NS 2 IN 1 snowplowingandremoval.com ns1.squareserver.net.deleted.gandi.net.} {172800 NS 2 IN 1 snowplowingandremoval.com ns2.squareserver.net.deleted.gandi.net.}] udp 192.41.162.30:53 {true 0 false false false false false false 0} <nil> <nil>}] 
DEBU[0000] DEPTH 03:            [Cache auth upsert for  com] 
DEBU[0000] DEPTH 04:                [SafeAddCachedAnswer: unable to cast to WithBaseAnswer:  . :  {EDNS0 0  4096 <nil> <nil> <nil> <nil> <nil> <nil> <nil> <nil> <nil> <nil> <nil> []}] 
DEBU[0000] DEPTH 04:                [inserted new cache entry for  {2 1 snowplowingandremoval.com}     is authority:  true   []] 
DEBU[0000] DEPTH 02:        [Cycling lookup successful. Name:  snowplowingandremoval.com , Layer:  . , Nameserver:  192.41.162.30:53] 
DEBU[0000] DEPTH 02:        [-> Authority found, iterating] 
DEBU[0000] DEPTH 02:        [Trying Authority:  {172800 NS 2 IN 1 snowplowingandremoval.com ns2.squareserver.net.deleted.gandi.net.}] 
DEBU[0000] DEPTH 03:            [Cached retrying lookup. Name:  {1 1 ns2.squareserver.net.deleted.gandi.net} , Layer:  . , Nameserver:  192.41.162.30:53] 
DEBU[0000] DEPTH 04:                [Cache request for:  ns2.squareserver.net.deleted.gandi.net  ( 1 )] 
DEBU[0000] DEPTH 05:                    [-> no entry found in cache for  ns2.squareserver.net.deleted.gandi.net] 
DEBU[0000] DEPTH 04:                [Cache auth check for  net] 
DEBU[0000] DEPTH 05:                    [Cache authority request for:  net  ( 2 )] 
DEBU[0000] DEPTH 06:                        [-> no entry found in cache for  net] 
DEBU[0000] DEPTH 04:                [Cache miss for  {1 1 ns2.squareserver.net.deleted.gandi.net} , Layer:  . , Nameserver:  192.41.162.30:53  going to the wire in retryingLookup] 
DEBU[0000] DEPTH 02:        [****WIRE LOOKUP***  udp   A   ns2.squareserver.net.deleted.gandi.net   192.41.162.30:53] 
DEBU[0000] DEPTH 04:                [Results from wire for name:  {1 1 ns2.squareserver.net.deleted.gandi.net} , Layer:  . , Nameserver:  192.41.162.30:53  status:  NOERROR  , err:  <nil>  result:  {[] [{172800 AAAA 28 IN 1 dns0.gandi.net 2001:4b98:d:1::39} {172800 A 1 IN 1 dns0.gandi.net 217.70.177.39} {172800 AAAA 28 IN 1 dns1.gandi.net 2001:4b98:d:1::45} {172800 A 1 IN 1 dns1.gandi.net 217.70.177.45} {172800 AAAA 28 IN 1 dns2.gandi.net 2001:4b98:d:589::211} {172800 A 1 IN 1 dns2.gandi.net 217.70.183.211} {172800 AAAA 28 IN 1 dns3.gandi.net 2001:4b98:c:13::14} {172800 A 1 IN 1 dns3.gandi.net 217.70.184.14} {172800 A 1 IN 1 dns6.gandi.net 162.159.24.111} {172800 A 1 IN 1 dns6.gandi.net 162.159.25.213} {172800 AAAA 28 IN 1 dns6.gandi.net 2400:cb00:2049:1::a29f:186f} {172800 AAAA 28 IN 1 dns6.gandi.net 2400:cb00:2049:1::a29f:19d5} {172800 AAAA 28 IN 1 dns4.gandi.net 2001:4b98:dc2:90:217:70:186:184} {172800 A 1 IN 1 dns4.gandi.net 217.70.186.184} {EDNS0 0  4096 <nil> <nil> <nil> <nil> <nil> <nil> <nil> <nil> <nil> <nil> <nil> []}] [{172800 NS 2 IN 1 gandi.net dns0.gandi.net.} {172800 NS 2 IN 1 gandi.net dns1.gandi.net.} {172800 NS 2 IN 1 gandi.net dns2.gandi.net.} {172800 NS 2 IN 1 gandi.net dns3.gandi.net.} {172800 NS 2 IN 1 gandi.net dns6.gandi.net.} {172800 NS 2 IN 1 gandi.net dns4.gandi.net.} {172800 NS 2 IN 1 gandi.net e.gandi-ns.fr.}] udp 192.41.162.30:53 {true 0 false false false false false false 0} <nil> <nil>}] 
DEBU[0000] DEPTH 04:                [Cache auth upsert for  net] 
DEBU[0000] DEPTH 05:                    [SafeAddCachedAnswer: unable to cast to WithBaseAnswer:  . :  {EDNS0 0  4096 <nil> <nil> <nil> <nil> <nil> <nil> <nil> <nil> <nil> <nil> <nil> []}] 
DEBU[0000] DEPTH 05:                    [inserted new cache entry for  {2 1 gandi.net}     is authority:  true   []] 
DEBU[0000] DEPTH 03:            [Cycling lookup successful. Name:  ns2.squareserver.net.deleted.gandi.net , Layer:  . , Nameserver:  192.41.162.30:53] 
DEBU[0000] DEPTH 03:            [-> Authority found, iterating] 
DEBU[0000] DEPTH 03:            [Trying Authority:  {172800 NS 2 IN 1 gandi.net dns2.gandi.net.}] 
DEBU[0000] DEPTH 03:            [Output from extract authorities:  217.70.183.211:53] 
DEBU[0000] DEPTH 04:                [Cached retrying lookup. Name:  {1 1 ns2.squareserver.net.deleted.gandi.net} , Layer:  gandi.net , Nameserver:  217.70.183.211:53] 
DEBU[0000] DEPTH 05:                    [Cache request for:  ns2.squareserver.net.deleted.gandi.net  ( 1 )] 
DEBU[0000] DEPTH 06:                        [-> no entry found in cache for  ns2.squareserver.net.deleted.gandi.net] 
DEBU[0000] DEPTH 05:                    [Cache auth check for  deleted.gandi.net] 
DEBU[0000] DEPTH 06:                        [Cache authority request for:  deleted.gandi.net  ( 2 )] 
DEBU[0000] DEPTH 07:                            [-> no entry found in cache for  deleted.gandi.net] 
DEBU[0000] DEPTH 05:                    [Cache miss for  {1 1 ns2.squareserver.net.deleted.gandi.net} , Layer:  gandi.net , Nameserver:  217.70.183.211:53  going to the wire in retryingLookup] 
DEBU[0000] DEPTH 03:            [****WIRE LOOKUP***  udp   A   ns2.squareserver.net.deleted.gandi.net   217.70.183.211:53] 
DEBU[0000] DEPTH 05:                    [Results from wire for name:  {1 1 ns2.squareserver.net.deleted.gandi.net} , Layer:  gandi.net , Nameserver:  217.70.183.211:53  status:  NOERROR  , err:  <nil>  result:  {[{86400 A 1 IN 1 ns2.squareserver.net.deleted.gandi.net 127.0.0.1}] [{1200 A 1 IN 1 e.gandi-ns.fr 217.70.177.33} {86400 A 1 IN 1 dns0.gandi.net 217.70.177.39} {86400 A 1 IN 1 dns1.gandi.net 217.70.177.45} {86400 A 1 IN 1 dns2.gandi.net 217.70.183.211} {86400 A 1 IN 1 dns3.gandi.net 217.70.184.14} {86400 A 1 IN 1 dns4.gandi.net 217.70.186.184} {86400 A 1 IN 1 dns6.gandi.net 162.159.25.213} {86400 A 1 IN 1 dns6.gandi.net 162.159.24.111} {1200 AAAA 28 IN 1 e.gandi-ns.fr 2001:4b98:d:1::1} {86400 AAAA 28 IN 1 dns0.gandi.net 2001:4b98:d:1::39} {86400 AAAA 28 IN 1 dns1.gandi.net 2001:4b98:d:1::45} {86400 AAAA 28 IN 1 dns2.gandi.net 2001:4b98:d:589::211} {86400 AAAA 28 IN 1 dns3.gandi.net 2001:4b98:c:13::14} {86400 AAAA 28 IN 1 dns4.gandi.net 2001:4b98:dc2:90:217:70:186:184} {86400 AAAA 28 IN 1 dns6.gandi.net 2400:cb00:2049:1::a29f:19d5} {86400 AAAA 28 IN 1 dns6.gandi.net 2400:cb00:2049:1::a29f:186f} {EDNS0 0  4096 <nil> <nil> <nil> <nil> <nil> <nil> <nil> <nil> <nil> <nil> <nil> []}] [{86400 NS 2 IN 1 gandi.net dns0.gandi.net.} {86400 NS 2 IN 1 gandi.net dns1.gandi.net.} {86400 NS 2 IN 1 gandi.net e.gandi-ns.fr.} {86400 NS 2 IN 1 gandi.net dns2.gandi.net.} {86400 NS 2 IN 1 gandi.net dns6.gandi.net.} {86400 NS 2 IN 1 gandi.net dns4.gandi.net.} {86400 NS 2 IN 1 gandi.net dns3.gandi.net.}] udp 217.70.183.211:53 {true 0 true false false false false false 0} <nil> <nil>}] 
DEBU[0000] DEPTH 06:                        [SafeAddCachedAnswer: detected poison:  e.gandi-ns.fr ( A ):  gandi.net  , aborting] 
DEBU[0000] DEPTH 04:                [Cycling lookup successful. Name:  ns2.squareserver.net.deleted.gandi.net , Layer:  gandi.net , Nameserver:  217.70.183.211:53] 
DEBU[0000] DEPTH 04:                [-> answers found]  
DEBU[0000] DEPTH 05:                    [Dropping  7  authority answers from output] 
DEBU[0000] DEPTH 05:                    [Dropping  17  additional answers from output] 
DEBU[0000] DEPTH 03:            [--> Auth Resolution of  217.70.183.211:53  success:  NOERROR] 
DEBU[0000] DEPTH 02:        [Output from extract authorities:  127.0.0.1:53] 
DEBU[0000] DEPTH 03:            [Cached retrying lookup. Name:  {2 1 snowplowingandremoval.com} , Layer:  snowplowingandremoval.com , Nameserver:  127.0.0.1:53] 
DEBU[0000] DEPTH 04:                [Cache request for:  snowplowingandremoval.com  ( 2 )] 
DEBU[0000] DEPTH 05:                    [-> no entry found in cache for  snowplowingandremoval.com] 
DEBU[0000] DEPTH 04:                [Cache miss for  {2 1 snowplowingandremoval.com} , Layer:  snowplowingandremoval.com , Nameserver:  127.0.0.1:53  going to the wire in retryingLookup] 
FATA[0000] none of the user-supplied local addresses ([10.134.52.42]) could connect to name server 127.0.0.1:53

Expected behavior
Expecting something like the following in the output file, which occurs if the --interative flag is omitted.

{
  "name": "snowplowingandremoval.com",
  "results": {
    "NS": {
      "data": {
        "additionals": [
          {
            "flags": "",
            "type": "EDNS0",
            "udpsize": 4096,
            "version": 0
          }
        ],
        "authorities": [
          {
            "answer": "ns1.squareserver.net.deleted.gandi.net.",
            "class": "IN",
            "name": "snowplowingandremoval.com",
            "ttl": 172800,
            "type": "NS"
          },
          {
            "answer": "ns2.squareserver.net.deleted.gandi.net.",
            "class": "IN",
            "name": "snowplowingandremoval.com",
            "ttl": 172800,
            "type": "NS"
          }
        ],
        "protocol": "udp",
        "resolver": "192.41.162.30:53"
      },
      "duration": 0.09128798,
      "status": "NOERROR",
      "timestamp": "2026-02-05T00:00:00Z"
    }
  }
}

Additional context
I'm trying to get the NS records for a bunch of domains in iterative mode. The domain snowplowingandremoval.com has been causing zdns to crash. Just looking for a workaround. Thanks for this incredible tool!

Metadata

Metadata

Labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions