[GH-ISSUE #522] [Errno 0] Resolver Error 0 (no error) #376

Closed
opened 2026-02-26 10:31:10 +03:00 by kerem · 2 comments
Owner

Originally created by @ThomasWaldmann on GitHub (Apr 17, 2023).
Original GitHub issue: https://github.com/nsupdate-info/nsupdate.info/issues/522

Originally assigned to: @ThomasWaldmann on GitHub.

From my inbox:

  File "/srv/nsupdate.info/repo/src/nsupdate/context_processors.py", line 42, in update_ips
    put_ip_into_session(s, ipaddr, max_age=MAX_IP_AGE / 2)
  File "/srv/nsupdate.info/repo/src/nsupdate/main/dnstools.py", line 454, in put_ip_into_session
    session[kind + '_rdns'] = rev_lookup(ipaddr)  # may be slow
  File "/srv/nsupdate.info/repo/src/nsupdate/main/dnstools.py", line 289, in rev_lookup
    return socket.gethostbyaddr(ipaddr)[0]

Exception Type: herror at /
Exception Value: [Errno 0] Resolver Error 0 (no error)

See also: https://github.com/saltstack/salt/pull/47294/files

Originally created by @ThomasWaldmann on GitHub (Apr 17, 2023). Original GitHub issue: https://github.com/nsupdate-info/nsupdate.info/issues/522 Originally assigned to: @ThomasWaldmann on GitHub. From my inbox: ``` File "/srv/nsupdate.info/repo/src/nsupdate/context_processors.py", line 42, in update_ips put_ip_into_session(s, ipaddr, max_age=MAX_IP_AGE / 2) File "/srv/nsupdate.info/repo/src/nsupdate/main/dnstools.py", line 454, in put_ip_into_session session[kind + '_rdns'] = rev_lookup(ipaddr) # may be slow File "/srv/nsupdate.info/repo/src/nsupdate/main/dnstools.py", line 289, in rev_lookup return socket.gethostbyaddr(ipaddr)[0] Exception Type: herror at / Exception Value: [Errno 0] Resolver Error 0 (no error) ``` See also: https://github.com/saltstack/salt/pull/47294/files
kerem 2026-02-26 10:31:10 +03:00
Author
Owner

@ThomasWaldmann commented on GitHub (Apr 18, 2023):

Python 3.10.11 (main, Apr  7 2023, 07:24:53) [Clang 14.0.0 (clang-1400.0.29.202)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import socket as s

>>> s.gethostbyaddr("1.1.1.1")
('one.one.one.one', ['1.1.1.1.in-addr.arpa'], ['1.1.1.1'])

>>> s.gethostbyaddr("1.1.1.2")
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
socket.herror: [Errno 1] Unknown host

>>> s.gethostbyaddr("")
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
OSError: wildcard resolved to multiple address

>>> s.gethostbyaddr("0.0.0.0")
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
socket.herror: [Errno 1] Unknown host

So, what does h_errno 0 even mean?

<!-- gh-comment-id:1513609787 --> @ThomasWaldmann commented on GitHub (Apr 18, 2023): ``` Python 3.10.11 (main, Apr 7 2023, 07:24:53) [Clang 14.0.0 (clang-1400.0.29.202)] on darwin Type "help", "copyright", "credits" or "license" for more information. >>> import socket as s >>> s.gethostbyaddr("1.1.1.1") ('one.one.one.one', ['1.1.1.1.in-addr.arpa'], ['1.1.1.1']) >>> s.gethostbyaddr("1.1.1.2") Traceback (most recent call last): File "<stdin>", line 1, in <module> socket.herror: [Errno 1] Unknown host >>> s.gethostbyaddr("") Traceback (most recent call last): File "<stdin>", line 1, in <module> OSError: wildcard resolved to multiple address >>> s.gethostbyaddr("0.0.0.0") Traceback (most recent call last): File "<stdin>", line 1, in <module> socket.herror: [Errno 1] Unknown host ``` So, what does `h_errno 0` even mean?
Author
Owner

@ThomasWaldmann commented on GitHub (Apr 18, 2023):

When running on the web server:

Python 3.9.2 (default, Feb 28 2021, 17:03:44) 
>>> import socket

>>> socket.gethostbyaddr("37.139.53.13")
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
socket.herror: [Errno 0] Resolver Error 0 (no error)
>>> 

nsupdate@web:~$ host 37.139.53.13
Host 13.53.139.37.in-addr.arpa not found: 2(SERVFAIL)
<!-- gh-comment-id:1513728598 --> @ThomasWaldmann commented on GitHub (Apr 18, 2023): When running on the web server: ``` Python 3.9.2 (default, Feb 28 2021, 17:03:44) >>> import socket >>> socket.gethostbyaddr("37.139.53.13") Traceback (most recent call last): File "<stdin>", line 1, in <module> socket.herror: [Errno 0] Resolver Error 0 (no error) >>> nsupdate@web:~$ host 37.139.53.13 Host 13.53.139.37.in-addr.arpa not found: 2(SERVFAIL) ```
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/nsupdate.info-nsupdate-info#376
No description provided.