要查看域名绑定了哪个空间(或服务器),通常需要进行以下几个步骤:
https://mxtoolbox.com/DNSLookup.aspx
。import dns.resolver
def query_dns(domain, record_type='A'):
try:
answers = dns.resolver.resolve(domain, record_type)
for rdata in answers:
print(f'{record_type} record: {rdata}')
except dns.resolver.NXDOMAIN:
print(f'The domain {domain} does not exist.')
except dns.resolver.NoAnswer:
print(f'The domain {domain} has no {record_type} records.')
except dns.resolver.Timeout:
print(f'The query for {domain} timed out.')
# 查询域名的A记录
query_dns('example.com')
通过以上步骤和方法,你应该能够查看并确认你的域名绑定了哪个空间。如果遇到具体问题,可以根据错误信息进一步排查和解决。
领取专属 10元无门槛券
手把手带您无忧上云