为搬瓦工VPS修改默认DNS服务以实现DNS解锁ChatGPT
本文最后更新于23天前,其中的信息可能已经有所发展或是发生改变。

参考文章:

24年年初的时候,看到搬瓦工补货的消息,马上就入手了一个年付$49.99的SPECIAL 10G KVM PROMO V5 – LOS ANGELES – CN2 GIA LIMITED EDITION,但是在之后的使用过程中,我发现只能使用网页端的ChatGPT,而无法使用iOS端的ChatGPT,前几天偶然看到了NodeSeek上的一篇文章,我对着操作了一下,发现确实可以成功解锁iOS端的ChatGPT,所以记录一下。

操作

所有的操作均在Ubuntu20.04系统下进行,系统不同操作可能也会有些许差异,具体操作流程如下:

  1. 先查询访问ChatGPT时返回的结果是什么:

    resolvectl query chatgpt.com

    结果可能为:

    chatgpt.com: 172.64.155.209                    -- link: eth0
                 104.18.32.47                      -- link: eth0
    
    -- Information acquired via protocol DNS in 9.7ms.
    -- Data is authenticated: no

    这说明在访问ChatGPT时返回的是ChatGPT的真实IP,而非搬瓦工提供的解锁DNS IP。

  2. 然后编辑/etc/systemd/resolved.conf文件,打开文件后其中内容为:

    #  This file is part of systemd.
    #
    #  systemd is free software; you can redistribute it and/or modify it
    #  under the terms of the GNU Lesser General Public License as published by
    #  the Free Software Foundation; either version 2.1 of the License, or
    #  (at your option) any later version.
    #
    # Entries in this file show the compile time defaults.
    # You can change settings by editing this file.
    # Defaults can be restored by simply deleting this file.
    #
    # See resolved.conf(5) for details
    
    [Resolve]
    #DNS=
    #FallbackDNS=
    #Domains=
    #LLMNR=no
    #MulticastDNS=no
    #DNSSEC=no
    #DNSOverTLS=no
    #Cache=yes
    #DNSStubListener=yes
    #ReadEtcHosts=yes

    我们需要更改其中的DNSFallbackDNS两行,将其修改为:

    DNS=172.31.255.2
    FallbackDNS=8.8.8.8 1.1.1.1

    保存文件。

  3. 重启服务:

    systemctl restart systemd-resolved
  4. 再次查询访问ChatGPT时返回的结果:

    chatgpt.com: 172.31.255.2                      -- link: eth0
    
    -- Information acquired via protocol DNS in 2.5ms.
    -- Data is authenticated: no
  5. 更换成功,可以打开iOS端的ChatGPT尝试是否可以正常访问。

原理

Ubuntu通过读取/etc/resolv.conf中的信息来确定DNS服务器,可以查看一下该文件内容:

# This file is managed by man:systemd-resolved(8). Do not edit.
#
# This is a dynamic resolv.conf file for connecting local clients to the
# internal DNS stub resolver of systemd-resolved. This file lists all
# configured search domains.
#
# Run "resolvectl status" to see details about the uplink DNS servers
# currently in use.
#
# Third party programs must not access this file directly, but only through the
# symlink at /etc/resolv.conf. To manage man:resolv.conf(5) in a different way,
# replace this symlink by a static file or a different symlink.
#
# See man:systemd-resolved.service(8) for details about the supported modes of
# operation for /etc/resolv.conf.

nameserver 127.0.0.53
options edns0

可以看到在第一行就有Do not edit.的字样,所以需要通过修改/etc/systemd/resolved.conf文件来达到修改DNS服务器的目的。

暂无评论

发送评论 编辑评论


				
|´・ω・)ノ
ヾ(≧∇≦*)ゝ
(☆ω☆)
(╯‵□′)╯︵┴─┴
 ̄﹃ ̄
(/ω\)
∠( ᐛ 」∠)_
(๑•̀ㅁ•́ฅ)
→_→
୧(๑•̀⌄•́๑)૭
٩(ˊᗜˋ*)و
(ノ°ο°)ノ
(´இ皿இ`)
⌇●﹏●⌇
(ฅ´ω`ฅ)
(╯°A°)╯︵○○○
φ( ̄∇ ̄o)
ヾ(´・ ・`。)ノ"
( ง ᵒ̌皿ᵒ̌)ง⁼³₌₃
(ó﹏ò。)
Σ(っ °Д °;)っ
( ,,´・ω・)ノ"(´っω・`。)
╮(╯▽╰)╭
o(*////▽////*)q
>﹏<
( ๑´•ω•) "(ㆆᴗㆆ)
😂
😀
😅
😊
🙂
🙃
😌
😍
😘
😜
😝
😏
😒
🙄
😳
😡
😔
😫
😱
😭
💩
👻
🙌
🖕
👍
👫
👬
👭
🌚
🌝
🙈
💊
😶
🙏
🍦
🍉
😣
Source: github.com/k4yt3x/flowerhd
颜文字
Emoji
小恐龙
花!
上一篇