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

科技回声

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

GitHubTwitter

首页

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

资源链接

HackerNews API原版 HackerNewsNext.js

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

Show HN: Configure domain redirects and URL forwarding with a simple DNS record

25 点作者 holic将近 11 年前

7 条评论

mike-cardwell将近 11 年前
Shame it requires polluting the root of your zone. Could have used a TXT record at &quot;_redirect-name.example.com&quot; or similar instead.<p>[edit] Also, this service will be abused by spammers and it will then become impossible to use a &quot;redirect.name&quot; URL in email.
评论 #8071690 未加载
tellnes将近 11 年前
I have done something similar myself. First I tried to put the TXT record at the same domain which I did want to redirect. To tackle the CNAME problem did I come up with a complicated solution which I also did write up (<a href="https://github.com/tellnes/dhr2" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;tellnes&#x2F;dhr2</a>). But when I actually tried to use it was it too complicated.<p>What I&#x27;m actually using now and have been using for some time is just a simple TXT record at a subdomain (eg _redirect.example.com). I also have a script which looks for these TXT records in my zones and adds A&#x2F;AAAA records when needed.<p>You can check it out as follows:<p><pre><code> dig TXT +noall +answer _redirect.infogym.no dig A +noall +answer infogym.no dig AAAA +noall +answer infogym.no curl -Is infogym.no | grep Location </code></pre> The plan is at some point to put the scripts I actually use on GitHub, but I have never come so far.
leepowers将近 11 年前
Hmmm, I&#x27;m not seeing the value proposition here. Or, I&#x27;m unclear why I&#x27;d use this service.<p>Here&#x27;s how I understand redirect.name working:<p>===<p>1. An A&#x2F;ALIAS&#x2F;ANAME record for &quot;example.com&quot; points to a redirect.name service (self-hosted or otherwise).<p>2. The service sees the &quot;example.com&quot; HTTP request via the host header.<p>3. Service does a DNS lookup for a matching TXT record redirect rule.<p>4. When found, the service issues a 301&#x2F;302 HTTP redirect, according to the matching rule.<p>===<p>Is this correct?<p>If so, compare to:<p>===<p>1. Create an A record for &quot;example.com&quot; that points to my Apache server.<p>2. Apache detects &quot;example.com&quot; via the host header.<p>3. Virtual host config for matching domain issues a 301&#x2F;302 HTTP redirect.<p>===<p>Aside from shuffling the redirect config from Apache to DNS, what&#x27;s the advantage of using redirect.name?<p>Additionally, every domain name registrar I&#x27;ve used includes a feature called &quot;URL forwarding&quot; that can redirect all HTTP requests for a domain to another. Again, what benefit does redirect.name provide that URL forwarding doesn&#x27;t?<p>I&#x27;d love to hear the use cases.
评论 #8072317 未加载
评论 #8071990 未加载
ForHackernews将近 11 年前
What is an ALIAS or ANAME record? I&#x27;ve never heard of that, and it isn&#x27;t listed among these record types: <a href="https://en.wikipedia.org/wiki/List_of_DNS_record_types" rel="nofollow">https:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;List_of_DNS_record_types</a>
评论 #8072611 未加载
fiatjaf将近 11 年前
This is nice. I can finally get some easy redirects here, as Cloudflare&#x27;s page rules don&#x27;t work.
nlo将近 11 年前
Clever! Thanks for making this open source. I really like small services like this written with Lua+nginx.
Koldark将近 11 年前
So I have to trust my domain with a 3rd party and pray they never shut down? No thanks!
评论 #8071603 未加载
评论 #8071800 未加载