Improve WOAcme ip check

This commit is contained in:
VirtuBox
2024-04-21 12:51:59 +02:00
parent e12cc063d6
commit 9a7c5e4ea1
2 changed files with 15 additions and 3 deletions

View File

@@ -51,3 +51,14 @@ class WOFqdn:
except requests.exceptions.RequestException as e:
print("Error occurred during request:", e)
return None
def get_domain_ip(self, wo_domain):
"""Get the server externet IP"""
try:
y = requests.get('http://v4.wordops.eu/dns/{0}/'.format(wo_domain))
domain_ip = (y.text).strip()
return domain_ip
except requests.exceptions.RequestException as e:
print("Error occurred during request:", e)
return None