6
C0D4
5y

!rant

Anyone here experienced with Route53?

I have a small issue I'm trying to think through on how to achieve with minimum effort and maintenance, essentially set once and walk away and never care about it again solution.

Basically what I have is:

sub.domain.com

and I need to get it to redirect over to

otherdomain.com/folderToGetTo/

Using a 301 would be ideal but how for the life of me do I go about serving a 301 redirect over a dns entry - short answer is I can't unless I'm missing something!

Both domains are owned by the same company so no issue in hijacking a subdomain... well besides internal politics but that's just another day 😏

First thoughts include setting up a S3 bucket with hosting and forcing the dns to that and then, redirect out of the bucket... seems overkill but will work.

Hoping to find a smaller solution that I don't have to justify a S3 bucket being used for a single file - audits suck alright🤷‍♂️

Oh and setting up a redirect at the originating domain will take longer then it's worth to setup and get approvals for so not worth the effort internally.

Yes I will accept "fuck off @C0D4" as an answer.

Comments
  • 3
    you can serve a 301, but not via DNS per se.

    You make sub.domain.com point to an IP via A, AAAA or CNAME entry, and the webserver that receives a request checks the host header.

    (nginx: `server_name sub.domain.com;`)

    You then redirect the user to that other page.

    location / {
    return 301 https://otherdomain.com/blablabla;
    }
  • 2
    @kescherRant see that last section

    I agree this would be the ideal, but I don't have a month to wait for someone else to finally get to it.

    I don't control originating domains servers so a backlog ticket that never gets actioned is worst case scenario.
  • 1
    @C0D4 Just make it an URGENT!! ticket

    Except all other tickets are probably urgent too
  • 2
    @kescherRant haha, I could set this as "world will end if not done" and it'll still be backlogged.
  • 0
    Why can't you use your subdomain for this:
    sub.domain/soweirdfile
    that points to the same resource as the 301 target? otherwise, setup your own web server for that subdomain, and serve the 301 from there, until someone gets around to do the other task.
  • 0
    You could also use an ALB with a fixed response, and point the DNS entry to that. But that's way more expensive than an S3 bucket.

    As far as I'm aware, you can't do a redirect straight from DNS - there has to be something intelligent in there.
  • 1
    Actually route53 is quite intelligent DNS but the OP asks for a HTTP response. Never gonna happen in DNS. I hate it when providers confuse clients by adding HTTP redirects to the "DNS" config panel.
  • 0
    http://otherdomain.com/folder”ain.com with <meta http-equiv=“refresh” content=“0;url=http://otherdomain.com/folder&rdquo; />
  • 0
    How about using a service like https://301redirect.website/
  • 0
    You obviously can't serve 301 over DNS because one's HTTP and the other is DNS. If you want sub.domain.com to be a reflection of otherdomain.com, then just use a round Robin DNS entry.

    If you want actual forwarding, i think you have to do it via HTTP. Round Robin is basically HTTP passthrough if you've ever used traditional application load balancers.

    Let me know if route 53 can even do round Robin dns.
Add Comment