-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.

4
  • 6
    Question could be written to be more clear. State up front what your problem is and your desired end state is, then after that go into current state. Make it easy to read. Best guess is you need to configure the blog to respond to requests for both domains, or on exampleblog.com you need to proxy_pass nginx through to the working domain.
    – Tim
    Dec 8, 2017 at 22:00
  • 1
    Either be honest about your actual domain names, or expect this to be closed because of inadequate information.
    – MadHatter
    Dec 9, 2017 at 12:25
  • 1
    What is this supposed to mean: blog is a CNAME of example.com. The CNAME points to exampleblog.com?
    – kasperd
    Dec 9, 2017 at 14:36
  • I have no Idea what you are trying to achive. Can you simplify your question, please? Also, remeber that you webserver will have to know to which DNS-Name he has to answer and that you cannot point blind DNS names to servers.
    – bjoster
    Dec 14, 2017 at 14:20

2 Answers 2

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
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).

3
  • Why not? I point cnames 3 deep :) Dec 10, 2017 at 1:12
  • It is not "must not", but "should not". See: serverfault.com/questions/309651/…
    – telcoM
    Dec 10, 2017 at 11:13
  • To summarize, pointing CNAMEs to CNAMES is generally regarded as a bad practice because it increases DNS overhead and allows the possibility of CNAME loops. And a CNAME loop is clearly an error. But you can point CNAMEs to CNAMEs if you are sure you have a good reason and are careful not to introduce loops.
    – telcoM
    Dec 10, 2017 at 13:05

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .