Merge pull request #68 from FafnerKeyZee/master

Fixing Unknown domain if only_global_lookups is set
pull/69/head
Raphaël Vinot 2020-03-17 16:46:29 +01:00 committed by GitHub
commit ebe162d8ee
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 1 deletions

View File

@ -191,7 +191,11 @@ class Lookyloo():
splitted_url = urlsplit(url)
if splitted_url.netloc:
if splitted_url.hostname:
ip = socket.gethostbyname(splitted_url.hostname)
try:
ip = socket.gethostbyname(splitted_url.hostname)
except socket.gaierror:
self.logger.info(f'Name or service not known')
return False
if not ipaddress.ip_address(ip).is_global:
return False
else: