multiple domains under one site
i have two domains and one of them simply redirects to the other, i want them to share the same settings, is there a way to add them under the same site? if not does cf provide a way to sync up settings for multiple domains? it looks like something that'd be done pretty frequently
32 Replies
If it just redirects then there's no need for any settings as the site it gets redirected to will handle everything
ah i see, thank you
hey sorry to bother, ive set up cname but its been hours and it still doesnt work (dig shows earlier records), am i doing something wrong or should i just wait
first one points to 100:: because its only used for cf redirects currently
what are you trying to do? You're cnaming everything in that domain to a differrent domain, which doesn't resolve to anything?
If you want them to be redirects, define those redirects in that zone as well
is that the only way to do that? they're the exact same so i dont wanna replicate everything
you want laralove.gay and lara.lv to both redirect to something else?
i want them both to redirect to the same thing
basically laralove.gay redirects to github.com/laralove and i want lara.lv to also redirect to github.com/laralove
this applies to every redirect
isnt cname the option to go for when you want two domains to do the same thing
ahh ok, yea you'd duplicate the redirects. You could redirect one site to another (like have all subdomains/paths from lara.lv go to laralove.gay), but then you'd have two hops
Do the same thing? No...
A CNAME is a "canonical redirect", basically saying "If you want an answer, go over here for DNS level stuff". In normal usage, you might have a few sites that CNAME to the same single site, which has A/AAAA records back to a web server, which accepts the host headers/urls/requests from the other domains.
Put in simpler words, for web requests, its like saying "Ask the same web server as you do here, for a response, but from this domain"
so the silver lining is cname doesnt work with cf redirects?
i used silver lining wrongly there
the takeaway is the word ig
Basically. You'd probably just want to recreate the redirects, they wouldn't be the exact same, as the source url would at least be different. If you wanted more central management you could use Bulk Redirects which are account-wide, but you'd still need seperate entries for both sites
thats unfortunate because i do have quite a few redirects
you could create a worker that handles it all on both, but you'd be paying for worker invocations, or you could add a single redirect on lara.lv and redirect all requests to laralove.gay keeping subdomain/path
thatd be a hop right?
like a noticable hop from the user
yea it's not the end of the world though, it'd be a bit slower sure, another dns resolution and request.
Could the user notice it? Probably not
basically lara.lv is just meant to be a shorthand
could drop the first domain entirely if i listed every place i use it
yea, I would just pick one to be the main and have the secondary redirect everything, then you'd only be managing stuff in one place
yea thats what i'll do for backwards compatibility
also when i feel like advertising gayness
thank you for your help
also
dig
is showing NOERROR
like its just like the resolutions never changed, is cf silently ignoring the error here
wydm silently ignoring the error?
From a DNS standpoint, that's perfectly fine
so has it just not propagated?
What hasn't?
the records
If you're talking about how trying to reach your website gives that error, that's unrelated to DNS
The CF Proxy tries to resolve the cname and send a request to it, and it fails
im more talking about the dns records the website has
those ips and the A records have been deleted
https://cdn.discordapp.com/attachments/1138445425649647667/1138535803807600740/Screenshot_2023-08-08_at_9.14.42_PM.png this is the current dns records but dig isnt showing that
ahhhh right that's just how proxied CNAMEs work
CF responds with its normal Proxy IPs, and internally resolves the CNAME on requests
ohh so you never see CNAMEs in dig?
If they're proxied, yea you wouldn't
ah yes i just tried with another domain that has cf pages cname and yea thats how it works apparently
it's just how reverse proxies work. With proxy enabled, you're telling Cloudflare, "Hey, stand in front of all requests to this". If they resolved the CNAME as-is, that wouldn't be reverse proxying/the requests wouldn't go through Cloudflare (well, more specifically, wouldn't go through your zone/website for that). It's a bit confusing when you're CNAMING another Cloudflare site/resource, but Cloudflare doesn't care/know about that
if i disable cf proxy would my cname thing work
i think thats worse than an additional hop tbh
no, normally you can't cname to another proxied CF site but sites in the same account have special behavior iirc and it's just resolving the 100::.
In order for it to work, you need the requests to go through the other zone request flow and all of its rules/etc (zone being website under "Websites" in your dash). You could achieve this with Custom Hostnames in the other zone if you wanted, but they still wouldn't match any page rules as the request url wouldn't be modified
If you were using Dynamic Redirects, you could match both with a custom rule using Custom hostnames and manage them within a singular website/zone.
It would probably be easier if you didn't do that though lol, and just redirected all to the other
yeahh ill do that thank youu