TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

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

25 pointsby holicalmost 11 years ago

7 comments

mike-cardwellalmost 11 years ago
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 未加载
tellnesalmost 11 years ago
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.
leepowersalmost 11 years ago
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 未加载
ForHackernewsalmost 11 years ago
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 未加载
fiatjafalmost 11 years ago
This is nice. I can finally get some easy redirects here, as Cloudflare&#x27;s page rules don&#x27;t work.
nloalmost 11 years ago
Clever! Thanks for making this open source. I really like small services like this written with Lua+nginx.
Koldarkalmost 11 years ago
So I have to trust my domain with a 3rd party and pray they never shut down? No thanks!
评论 #8071603 未加载
评论 #8071800 未加载