设置采用浮动 IP 的防封锁服务器
使用集合让一切井井有条
根据您的偏好保存内容并对其进行分类。
简介
在网络审查严格的环境下,Outline 服务器有时可能会被发现和封锁。如果服务器设置正确,即使被封锁也有可能恢复,并且操作难度也不大。我们将使用 DNS 和浮动 IP 来恢复被封锁的服务器。DNS 是一种互联网技术,可以将域名(例如 getoutline.org
)转换为实际 IP 地址(例如 216.239.36.21
);而浮动 IP 是一项云功能,支持向一个 Outline 服务器分配多个 IP 地址。
要求
只要具备一定基础技能,就能按照本指南完成操作。对 DNS 有基本了解会起到帮助作用,但并非必要条件。这篇 MDN 指南介绍了域名的概念,可供参考。
为了提供具体示例,我们将使用 DigitalOcean 和 Google Domains,但只要是支持分配 IP 地址的云提供商(例如 Google Cloud 或 AWS Lightsail)以及域名注册商(例如 AWS Route 53)均可使用。
操作说明
下表概述了轮换服务器 IP 地址的步骤:
购买域名。
将该域名指向我们服务器的 IP 地址。
使用该域名发放访问密钥。
为服务器的 Droplet 分配浮动 IP。
更改域名,使其指向新的 IP 地址。
在 DigitalOcean 上创建 Outline 服务器
如果您已有正在运行的 DigitalOcean 服务器,请直接跳到下一步。
打开 Outline 管理器,点击左下角的“+”进入服务器创建界面。
点击“DigitalOcean”按钮上的“创建服务器”,按照应用中的说明操作。

为服务器设置主机名
前往 Google Domains,点击“找到最佳选择”。
在搜索栏中输入域名,然后选择一个想要的名称。在示例中,我们使用了 outlinedemo.info
。
前往 Google Domains 中的“DNS”标签页。在“自定义资源记录”下的“IPV4 地址”字段中输入服务器的 IP 地址。
在 Outline 管理器中,前往服务器的“设置”标签页。在“主机名”下输入您购买的主机名,然后点击“保存”。这会使得日后所有的访问密钥使用此主机名,而不是使用服务器的 IP 地址。

更改服务器的 IP 地址
在 DigitalOcean 的“Droplets”页面上找到您的服务器。
在窗口的右上角,点击“Floating IP”(浮动 IP)旁边的“Enable Now”(立即启用)。

- 在 Droplet 列表中找到您的服务器,然后点击“Assign Floating IP”(分配浮动 IP)。

返回 Google Domains 中的“DNS”标签页。
像之前一样更改 IP 地址,但这一次改用新的浮动 IP 地址。此操作最多可能需要 48 小时才能生效,但通常只需要几分钟。
进入 Google 的在线 DNS 工具,输入您的域名即可查看在最后一步中完成的更改何时生效。

一旦此更改生效,客户端就会连接到新的 IP 地址。您可以使用新密钥连接到服务器,打开 https://ipinfo.io,确保页面显示了服务器的新 IP 地址。
总结
轮换 Outline 服务器的 IP 地址可以快速将服务器解除封锁,恢复对客户端的服务。如有其他疑问,欢迎随时在通知帖子下发表评论,访问 Outline 的支持页面,或者直接与我们联系。
如未另行说明,那么本页面中的内容已根据知识共享署名 4.0 许可获得了许可,并且代码示例已根据 Apache 2.0 许可获得了许可。有关详情,请参阅 Google 开发者网站政策。Java 是 Oracle 和/或其关联公司的注册商标。
最后更新时间 (UTC):2025-07-25。
[null,null,["最后更新时间 (UTC):2025-07-25。"],[[["\u003cp\u003eOutline servers can be blocked in highly censored networks, but recovery is possible by rotating the server's IP address.\u003c/p\u003e\n"],["\u003cp\u003eThe recovery process involves using DNS to translate a domain name to an IP address and using a Floating IP feature to assign multiple IP addresses to the server.\u003c/p\u003e\n"],["\u003cp\u003eUsers need to purchase a domain name and point it to the server's IP address and can use services such as DigitalOcean and Google Domains, or similar providers.\u003c/p\u003e\n"],["\u003cp\u003eAfter setting up a hostname and assigning a Floating IP, users must update their domain's DNS records with the new Floating IP address.\u003c/p\u003e\n"],["\u003cp\u003eOnce the DNS changes propagate, clients will connect to the server using the new IP address, restoring access to previously blocked servers.\u003c/p\u003e\n"]]],["To recover a blocked Outline server, purchase a domain name and point it to the server's IP address. Then, issue access keys using the domain name. Next, assign a Floating IP to the server. Finally, update the domain name's DNS records to point to the new Floating IP address. This process switches the server's address without changing the access keys. Verify the update by using online tools to check if the domain is directing to the new IP.\n"],null,["# Set Up a Blocking-Resistant Server With Floating IPs\n\nIntroduction\n------------\n\nOutline servers can sometimes face the problem of being discovered and blocked\nfrom highly censored networks. It's possible and not too difficult to recover a\nblocked server if it was set up correctly. We will do this using DNS, the\nInternet technology which translates domain names (like `getoutline.org`) to\nphysical IP addresses (like `216.239.36.21`), and Floating IPs, a cloud feature\nwhich lets you assign more than one IP address to an Outline server.\n\nRequirements\n------------\n\nThere is a low level of technical skill needed to follow this guide. A basic\nunderstanding of DNS is helpful, but not required. See the\n[MDN](https://developer.mozilla.org/docs/Learn/Common_questions/What_is_a_domain_name)\nguide on domain names for an introduction.\n\nTo have a concrete example we will use DigitalOcean and Google Domains, but any\ncloud provider which allows assignment of IP addresses (e.g. Google Cloud or\n[AWS Lightsail](https://lightsail.aws.amazon.com/ls/docs/en_us/articles/lightsail-create-static-ip))\nand any domain registrar (e.g.\n[AWS Route 53](https://lightsail.aws.amazon.com/ls/docs/en_us/articles/amazon-lightsail-using-route-53-to-point-a-domain-to-an-instance))\nwill work just as well.\n\nInstructions\n------------\n\n1. The following list summarizes the steps to rotate the IP address of a server:\n\n2. Purchase a domain name.\n\n3. Point the domain name to our server's IP address.\n\n4. Issue access keys using the domain name.\n\n5. Assign a Floating IP to the server's Droplet.\n\n6. Change the domain name to point at the new IP address.\n\nCreate an Outline Server on DigitalOcean\n----------------------------------------\n\nIf you have a running DigitalOcean server, skip to the next step.\n\n1. Open Outline Manager and Click \"+\" at the bottom left to enter the server\n creation screen.\n\n2. Click \"Create Server\" on the \"DigitalOcean\" button and follow the directions\n in the app.\n\nMake a Hostname for Your Server\n-------------------------------\n\n1. Navigate to [Google Domains](https://domains.google.com/m/registrar/) and\n click \"Find the perfect one\".\n\n2. Enter a domain name in the search bar and choose a name. We used\n `outlinedemo.info` as an example.\n\n3. Navigate to the DNS tab on Google Domains. Under \"Custom Resource Records\",\n type your server's IP address in the field marked \"IPV4 address\".\n\n4. Navigate to the \"Settings\" tab for your server in Outline Manager. Under\n \"Hostname\", type the hostname you purchased and click \"SAVE\". This will make\n all future access keys use this hostname instead of the server's IP address.\n\nChange the Server's IP address\n------------------------------\n\n1. Navigate to your server on DigitalOcean's \"Droplets\" page.\n\n2. Click \"Enable Now\" in the top right of the window next to \"Floating IP\".\n\n1. Find your server in the list of Droplets and click \"Assign Floating IP\".\n\n1. Navigate back to the DNS tab on Google Domains.\n\n2. Change the IP address as before, but this time with the new Floating IP\n address. This may take up to 48 hours to take place, but often it only takes\n a few minutes.\n\n3. Navigate to [Google's Online DNS tool](https://toolbox.googleapps.com/apps/dig/#A/)\n and enter your domain name to see when the change in the last step took\n place.\n\nOnce this change propagates, clients will now connect to the new IP address. You\ncan connect to your server with a new key and open \u003chttps://ipinfo.io\u003e to make\nsure that you see your server's new IP address.\n\nConclusion\nRotating IP addresses of an Outline server can be a fast way to unblock a server\nand restore service to clients. For more questions, feel free to comment on the\n[announcement post](https://redd.it/hrbhz4), visit\n[Outline's support page](https://support.getoutline.org/) or\n[contact us directly](https://support.getoutline.org/s/contactsupport)."]]