Two domains pointing to same DNS

Hello there.

So basically I’ve got two domains, let’s call them example.com and example(dot)net.

I have some basic DNS on example.com, let’s say:

Is there a way to have the same DNS records on example(dot)net as well?
So like if I went to api.example(dot)net it would be the same as api.example(dot)com etc.

There is nothing automatic, but you could duplicate all .com records as CNAMEs in the .net domain. In that way you at least wont have to configure IP addresses twice.

Typically Cloudflare is not too fond of such pointers to records already managed by Cloudflare and throws a 1014 error, however that seems to apply only when referencing domains belonging to another user account. Assuming your two domains belong to the same account, the following approach for your .net domain might just work

CNAME @ -> example.com
CNAME api -> api.example.com
CNAME mail -> mail.example.com

Keep in mind your server will also need to know about the .net records, in case you configured virtual hosts for .com.

Thank you for your reply.

What do you mean by ‘your server will also need to know about the .net records’?
For example, I have this Github Pages site, and I can only add one domain record to it.
Is there anything I can do there?

I am not sure what you mean. Can you post the two domains and the records you’d like to match?

I have two ‘A’ records on roccodev.pw pointing to GitHub’s IP (192.30.252.153, 192.30.252.154).
When I CNAME ‘roccodev.pw’ from another domain of mine, I obviously get an error in my browser since GitHub most likely doesn’t recognize the other domain.

The issue is, GitHub only allows one custom domain per account, so is there any way to ‘point’ the other domain to that?

Not via DNS. You could configure a redirect with a page rule.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.