V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
V2EX 提问指南
tsparrot
V2EX  ›  问与答

请教一个关于域名解析的问题

  •  
  •   tsparrot · 2019-02-09 13:36:05 +08:00 · 2281 次点击
    这是一个创建于 1875 天前的主题,其中的信息可能已经有所发展或是发生改变。

    前几天把博客域名的域名解析服务商从 namesilo 自带的解析服务换成了腾讯的 dnspod,然后只添加了一个子域名的记录,博客要用到的两个域名忘记添加了(捂脸 以致我用域名访问博客的时候显示找不到 IP 地址(这个现在能理解),在向 dnspod 添加博客域名的记录后可以正常访问。 我的疑问来自于,我之前用 IP 访问时也出现了同样的结果,向朋友请教他觉得是我没有用 ip+wordpress 端口访问,但是为什么会显示无法找到 ip 地址呢? 捕获.JPG 这是因为浏览器缓存使得这个输入 IP 访问时默认使用了之前的域名吗?还是别的什么原因

    15 条回复    2020-05-26 17:13:51 +08:00
    kerryeva
        1
    kerryeva  
       2019-02-09 13:39:53 +08:00
    同小白,dns ttl 时间?
    luminous
        2
    luminous  
       2019-02-09 13:44:52 +08:00 via Android
    这个图上面怎么看你也使用的是域名访问的啊
    使用 ip 访问的话即使有错误信息也不会是这个
    tsparrot
        3
    tsparrot  
    OP
       2019-02-09 14:02:30 +08:00 via Android
    @luminous 就是输了 ip 然后回车就这样了,所以我怀疑和浏览器缓存有关系,但是不太清楚这方面的知识
    lhx2008
        4
    lhx2008  
       2019-02-09 14:17:52 +08:00 via Android
    地址栏变了,应该是你自己调了跳转
    msg7086
        5
    msg7086  
       2019-02-09 14:31:27 +08:00
    IP 访问跳转到域名,然后 NXDOMAIN。
    liuxyon
        6
    liuxyon  
       2019-02-09 14:59:37 +08:00
    用我的 dns 服务器就没问题了
    liuxyon
        7
    liuxyon  
       2019-02-09 15:00:26 +08:00
    从 2 月份开始没更新 dns 服务器到最新,很可能不能解析。
    namesc
        8
    namesc  
       2019-02-09 15:14:34 +08:00
    两种可能:

    一、在 Nginx server 配置文件把 IP 重定向到了域名
    二、IP 可以正常访问到网站,但是网站程序 WordPress 只认设置的首页地址,而且你之前已经设置了域名作为首页地址,所以跳转到了域名。

    另外:

    PHP 5 已经凉透了,安全更新没有了,速度也远不如 PHP 7,WordPress 又不是不支持 PHP 7,你应该用 PHP 7。
    tsparrot
        9
    tsparrot  
    OP
       2019-02-09 15:27:07 +08:00 via Android
    @lhx2008 我应该是没调啊,老哥知道怎么调回去吗
    xfspace
        10
    xfspace  
       2019-02-09 16:33:59 +08:00 via Android   ❤️ 1
    # curl 192.157.192.103 -I -H "Host: tsparrot.com"
    HTTP/1.1 200 OK
    Server: nginx/1.2.1
    Date: Sat, 09 Feb 2019 08:31:23 GMT
    Content-Type: text/html; charset=UTF-8
    Connection: keep-alive
    X-Powered-By: PHP/5.4.45-0+deb7u14
    Link: <http://tsparrot.com/wp-json/>; rel="https://api.w.org/"
    Link: <http://tsparrot.com/>; rel=shortlink

    # curl 192.157.192.103 -I
    HTTP/1.1 301 Moved Permanently
    Server: nginx/1.2.1
    Date: Sat, 09 Feb 2019 08:31:39 GMT
    Content-Type: text/html; charset=UTF-8
    Connection: keep-alive
    X-Powered-By: PHP/5.4.45-0+deb7u14
    Location: http://tsparrot.com/



    上 nginx 配置文件
    nginx -T
    KasuganoSoras
        11
    KasuganoSoras  
       2019-02-09 17:55:30 +08:00
    tsparrot
        12
    tsparrot  
    OP
       2019-02-09 19:02:45 +08:00 via Android
    @KasuganoSoras 在 dnspod 里添加记录就能上了,但是之前 ip 访问遇到的问题没搞明白
    tsparrot
        13
    tsparrot  
    OP
       2019-02-09 19:03:12 +08:00 via Android
    @xfspace 谢谢老哥
    tsparrot
        14
    tsparrot  
    OP
       2019-02-09 19:03:29 +08:00 via Android
    @namesc 感谢老哥解答
    dennyguo
        15
    dennyguo  
       2020-05-26 17:13:51 +08:00
    好用的 DNS 域名解析推荐:DNSPOD~
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   2803 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 664ms · UTC 14:49 · PVG 22:49 · LAX 07:49 · JFK 10:49
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.