-4

I'm having a hard time getting some DNS configured.

I work on blog.example.com. blog is a CNAME of example.com. The CNAME points to exampleblog.com which points to an IP address.

I have access to the DNS for exampleblog.com. I do not have access to the DNS for example.com. I can get them to change it but it would be difficult.

I have an A record on exampleblog.com which points to a managed WordPress hosting account. This managed WP hosting account is for blog.example.com on an Nginx server.

blog.example.com is working and showing my content. exampleblog.com is throwing a 404 error. Everything must be served over https as well.

Any suggestions on how I can fix exampleblog.com with my current level of DNS access? I can use Cloudflare if that is helpful. I tried setting up a page rule but it broke blog.example.com and exampleblog.com.

Tom
  • 93

2 Answers2

1
  1. Check that the DNS resolution for exampleblog.com points to the right address
  2. Check your vhost configuration and make sure it matches both blog.example.com and exampleblog.com
  3. Make sure that WP is configured to answer on both domains
Px2016
  • 109
0

Note that a CNAME record should not point to another CNAME, but directly to the corresponding A record. Like this:

blog.example.com. IN CNAME exampleblog.com.

and then

exampleblog.com. IN A 192.0.2.10  # or whatever is the actual IP

If your DNS is set up similar to this, then the 404 error on exampleblog.com address could be caused by name-based virtual hosting being active on 192.0.2.10 (or whatever the IP address of the actual server is) and the server has no valid virtual host configuration (or just no content) for the exampleblog.com virtual host.

So, in short, this does not look like a DNS error at all. It looks more like the web server does not know how to respond when called as exampleblog.com rather than blog.example.com, and so it will respond with a 404 error message.

For HTTPS, you would need either a single SSL/TLS certificate that covers both your DNS names using SAN (Subject Alternative Names), or if you have two separate server certificates, then both the client and the server would have to support SSL/TLS SNI (Server Name Indication).

telcoM
  • 4,876