AskEric / app.py
EricGEGE's picture
Update app.py
df025db verified
raw
history blame
381 Bytes
import socket
def test_dns_resolution():
try:
# Telegram API hostname
host = 'api.telegram.org'
print(f"Resolving DNS for {host}")
ip = socket.gethostbyname(host)
print(f"DNS resolution successful: {ip}")
except socket.gaierror as e:
print(f"DNS resolution failed: {e}")
if __name__ == "__main__":
test_dns_resolution()