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
Soham
Soham16mo ago
If it just redirects then there's no need for any settings as the site it gets redirected to will handle everything
laralove
laraloveOP16mo ago
ah i see, thank you
laralove
laraloveOP16mo ago
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
Chaika
Chaika16mo ago
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
laralove
laraloveOP16mo ago
is that the only way to do that? they're the exact same so i dont wanna replicate everything
Chaika
Chaika16mo ago
you want laralove.gay and lara.lv to both redirect to something else?
laralove
laraloveOP16mo ago
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
Chaika
Chaika16mo ago
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"
laralove
laraloveOP16mo ago
so the silver lining is cname doesnt work with cf redirects? i used silver lining wrongly there the takeaway is the word ig
Chaika
Chaika16mo ago
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
laralove
laraloveOP16mo ago
thats unfortunate because i do have quite a few redirects
Chaika
Chaika16mo ago
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
laralove
laraloveOP16mo ago
thatd be a hop right? like a noticable hop from the user
Chaika
Chaika16mo ago
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
laralove
laraloveOP16mo ago
basically lara.lv is just meant to be a shorthand could drop the first domain entirely if i listed every place i use it
Chaika
Chaika16mo ago
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
laralove
laraloveOP16mo ago
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
lara@Laras-MacBook-Air ~ % dig lara.lv @1.1.1.1

; <<>> DiG 9.10.6 <<>> lara.lv @1.1.1.1
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 45844
;; flags: qr rd ra; QUERY: 1, ANSWER: 2, AUTHORITY: 0, ADDITIONAL: 1

;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 1232
;; QUESTION SECTION:
;lara.lv. IN A

;; ANSWER SECTION:
lara.lv. 300 IN A 172.67.165.223
lara.lv. 300 IN A 104.21.66.240

;; Query time: 128 msec
;; SERVER: 1.1.1.1#53(1.1.1.1)
;; WHEN: Tue Aug 08 21:32:40 +03 2023
;; MSG SIZE rcvd: 68
lara@Laras-MacBook-Air ~ % dig lara.lv @1.1.1.1

; <<>> DiG 9.10.6 <<>> lara.lv @1.1.1.1
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 45844
;; flags: qr rd ra; QUERY: 1, ANSWER: 2, AUTHORITY: 0, ADDITIONAL: 1

;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 1232
;; QUESTION SECTION:
;lara.lv. IN A

;; ANSWER SECTION:
lara.lv. 300 IN A 172.67.165.223
lara.lv. 300 IN A 104.21.66.240

;; Query time: 128 msec
;; SERVER: 1.1.1.1#53(1.1.1.1)
;; WHEN: Tue Aug 08 21:32:40 +03 2023
;; MSG SIZE rcvd: 68
Chaika
Chaika16mo ago
wydm silently ignoring the error? From a DNS standpoint, that's perfectly fine
laralove
laraloveOP16mo ago
so has it just not propagated?
Chaika
Chaika16mo ago
What hasn't?
laralove
laraloveOP16mo ago
the records
Chaika
Chaika16mo ago
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
laralove
laraloveOP16mo ago
im more talking about the dns records the website has those ips and the A records have been deleted
Chaika
Chaika16mo ago
ahhhh right that's just how proxied CNAMEs work CF responds with its normal Proxy IPs, and internally resolves the CNAME on requests
laralove
laraloveOP16mo ago
ohh so you never see CNAMEs in dig?
Chaika
Chaika16mo ago
If they're proxied, yea you wouldn't
laralove
laraloveOP16mo ago
ah yes i just tried with another domain that has cf pages cname and yea thats how it works apparently
Chaika
Chaika16mo ago
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
laralove
laraloveOP16mo ago
if i disable cf proxy would my cname thing work i think thats worse than an additional hop tbh
Chaika
Chaika16mo ago
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
laralove
laraloveOP16mo ago
yeahh ill do that thank youu
Want results from more Discord servers?
Add your server