ยฉ 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
Cloudflare DevelopersCD
Cloudflare Developersโ€ข2y agoโ€ข
2 replies
Emjayen

DNS resolve depending on service.

I need to resolve a domain to a particular address depending on service; essentially:

HTTPS (Browser) -> CloudFlare
Elsewise -> Origin server

As far as I can tell there are no RRs that could coerce this behaviour; I considered SRV's but browsers don't consider them, and URI records are seemingly obsolete.

One option would be to map both the origin and CF. The main problem here is that, the particular non-HTTPS client software just relies on whatever address is returned by
gethostaddr()
gethostaddr()
and assumes there's only one (unlike browsers, which will attempt others). Relying on the undefined ordering of A records (and everything above to get to
gethostaddr()
gethostaddr()
) would be very hacky.

The last resort would be doing HTTP redirection at the origin, redirecting to HTTPS/CF.
Cloudflare Developers banner
Cloudflare DevelopersJoin
Welcome to the official Cloudflare Developers server. Here you can ask for help and stay updated with the latest news
85,042Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements

Similar Threads

Unable to resolve loadbalancer DNS
Cloudflare DevelopersCDCloudflare Developers / general-help
3y ago
DNS not resolve hostname / Not Accessible
Cloudflare DevelopersCDCloudflare Developers / general-help
2y ago
Service tunnel without public dns
Cloudflare DevelopersCDCloudflare Developers / general-help
3y ago