oramoetaro
oramoetaro

Reputation: 563

How to mask a subdomain URL with CNAME record?

I need to mask the subdomain URL http://3477er.domainB.com with https://sub.domainA.com Both in different servers.

So I create the "sub" alias in domainA server pointing to https://34tter.domainB.com with a CNAME record and waited for its propagation.

I thought I should see http://3477er.domainB.com content when I type http://sub.domainA.com in browser. Instead I get the message DNS_PROBE_FINISHED_NXDOMAIN Isn't this the way a CNAME record works?

Is there any other way to achieve my subdomain masking goal?

Upvotes: 0

Views: 2104

Answers (1)

David
David

Reputation: 1083

If you are receiving a DNS_PROBE_FINISHED_NXDOMAIN error, it means one of the subdomains you listed is not resolving to an IP address. I would test both subdomains here -

https://mxtoolbox.com/DNSLookup.aspx

There are a couple important notes here though -

  1. This will only work if the server on domainB has a binding setup for either any (wildcard) domains (usually bad idea), or a binding specifically for your domainA subdomain.
  2. This will only hide your domainB subdomain on a very basic level, if this is what you need. So, in other words, hiding it from non-tech savvy users. It can't be relied upon if security is a concern, since someone could easily find domainB with a DNS lookup.

To truly mask the 'origin' server, you'd need to implement a proxy. This could either be done by making the requests on your domainB server itself, or by using serverless tech (such as Cloudflare Workers, AWS Lamba, etc.). However, this still won't prevent people making requests directly to domainA if they do discover it.

Upvotes: 1

Related Questions