-4

I have a web server at home. I bought a top level domain mydomain.com and I want it to point to my server. I also have a duckdns domain mydomain.duckdns.org. They say in their faq:

Q: I want to use my own Domain name with DuckDNS, can I do this?

A: Yes you can. At your NAME provider set your purchased record as a CNAME to your duckdns.org record. www.ilikeweasels.org CNAME weasels.duckdns.org

But that doesn't seem to do the trick. If there is an A record then it doesn't allow me to setup a CNAME. Then if I delete the A and have the CNAME only, then it I get this:

M-PRIF -E- [mydomain.com] Cannot get domain data (-nameserverIP- -nameservername-)

UPDATE: So I could manage to set it up for www.mydomain.com, but not for mydomain.com.

UPDATE2: I've just read this one Why can't a CNAME record be used at the apex (aka root) of a domain? and It seems I shouldn't create a CNAME record for the root domain. So the question here is whether there is any workaround?

fishmong3r
  • 141
  • 1
  • 9
  • 4
    [I would not recommend DuckDNS to anyone.](http://serverfault.com/a/713737/152073) – Andrew B May 17 '16 at 19:19
  • @AndrewB And what would you recommend? – fishmong3r May 17 '16 at 19:28
  • 1
    Just a note on terminology: `mydomain.com` is not a *top-level domain* (`com`, on the other hand, is an example of a tld). Also *the root domain* sounds like it refers to the actual root (aka `.`), particularly written with definite article like that. – Håkan Lindqvist May 17 '16 at 21:26

3 Answers3

1

Found a workaround. I left the root A record and created a CNAME for www.mydomain.com. Then with HTTP 301 all requests going to mydomain.com have been redirected to www.mydomain.com which then points to mydomain.duckdns.org and finally my webserver.

fishmong3r
  • 141
  • 1
  • 9
0

I had the same issue and would like to leave my solution here for future travelers:

I created two DNS entries. One CNAME that maps all sub domains *.mydomain.com to mydomain.duckdns.org. And one ALIAS that points mydomain.com to mydomain.duckdns.org.

Then on my local server I'm using a reverse proxy to handle some sub domains but that is just optionally.

  • A `CNAME` (or [a Route53 specific *alias*](https://serverfault.com/a/906618/274176)) does not *redirect* anything, as [redirection](https://developer.mozilla.org/en-US/docs/Web/HTTP/Redirections) is a concept of the HTTP protocol. – Esa Jokinen Dec 31 '22 at 12:38
  • Thanks, I fixed that. – Metin Celik Jan 02 '23 at 02:06
-1

The physical address is designated by the A record which a CNAME would refer to, so it's strange that you are not able to set up a CNAME.

Are you maybe reversing the order? I.E. putting the CNAME where the original host name should be or vice versa?

EDIT: I just saw your edit, did this solve your issue? Regardless you should most definitely be able to set up a CNAME as you mentioned in your question.

INV3NT3D
  • 103
  • 3
  • No, I'm still unable to get `mydomain.com` to point to my server. – fishmong3r May 17 '16 at 19:05
  • Best of luck, my apologies for jumping in without much of answer. Here are some links I found. [Here](http://serverfault.com/questions/274106/is-there-any-way-to-point-the-root-domain-to-a-cname) and [here](http://mrooney.github.io/blog/2012/05/01/dns-root-slash-apex-cnames-in-practice/) – INV3NT3D May 17 '16 at 19:12