Skip to content
This repository was archived by the owner on Feb 19, 2020. It is now read-only.

Commit a9a0de8

Browse files
committed
support /etc/hosts
1 parent e0889e1 commit a9a0de8

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

sleekxmpp/xmlstream/resolver.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -150,6 +150,8 @@ def resolve(host, port=None, service=None, proto='tcp',
150150
for address in get_A(host, resolver=resolver,
151151
use_dnspython=use_dnspython):
152152
results.append((host, address, port))
153+
for address in get_other_resolves(host):
154+
results.append((host, address, port))
153155

154156
for host, address, port in results:
155157
yield host, address, port
@@ -253,6 +255,10 @@ def get_AAAA(host, resolver=None, use_dnspython=True):
253255
return []
254256

255257

258+
def get_other_resolves(host, port):
259+
return socket.gethostbyname(host)
260+
261+
256262
def get_SRV(host, port, service, proto='tcp', resolver=None, use_dnspython=True):
257263
"""Perform SRV record resolution for a given host.
258264

0 commit comments

Comments
 (0)