域名访问:
IP访问:
问题1:域名无法解析
ipconfig /flushdns
命令)。问题2:IP地址访问受限
以下是一个简单的Python示例,展示如何通过域名和IP地址访问网站:
import requests
# 通过域名访问
response_domain = requests.get('http://www.example.com')
print(response_domain.status_code)
# 通过IP地址访问
response_ip = requests.get('http://93.184.216.34')
print(response_ip.status_code)
希望以上信息对你有所帮助!
领取专属 10元无门槛券
手把手带您无忧上云