TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

Ask HN: How to distribute wildcard subdomains to different servers

2 点作者 NameNickHN大约 10 年前
I have a list of subdomains pointing to one server (1.2.3.4) right now.<p>1001.example.com 1002.example.com 1003.example.com 1004.example.com 1005.example.com 1006.example.com<p>I want to run the next set of subdomains on a different server (9.8.7.6):<p>2001.example.com 2002.example.com 2003.example.com 2004.example.com 2005.example.com 2006.example.com<p>I don&#x27;t want configure each individual subdomain. I&#x27;d rather do configuration for a range, like:<p>[1000-1999].example.com =&gt; 1.2.3.4 [2000-2999].example.com =&gt; 9.8.7.6 [3000-3999].example.com =&gt; 2.4.6.8<p>I tried to search for answers to this problem but I&#x27;m not even sure for what to search. Has anyone done this kind of thing?

1 comment

nedrocks大约 10 年前
I don&#x27;t believe DNS supports regex and in fact a comment thread from 2010 on OpenDNS specifically states they do not support it [1]. A very simple solution for this is a load balancer. Nginx [2] works quite well and routing is a breeze. The downside is maintaining the instance on which all of your traffic flows. You&#x27;ll likely need a hotswappable fail over hosted in a different data center to be safe.<p>[1] - <a href="https://forums.opendns.com/comments.php?DiscussionID=8440" rel="nofollow">https:&#x2F;&#x2F;forums.opendns.com&#x2F;comments.php?DiscussionID=8440</a> [2] - <a href="http://wiki.nginx.org/Main" rel="nofollow">http:&#x2F;&#x2F;wiki.nginx.org&#x2F;Main</a>
评论 #9105716 未加载