I am having troubles to get my custom domain working with Gigalixir because of DNS. Gigalixir can have a custom domain: you must create a CNAME record and point it to gigalixirdns.com, something like
www.example.com ---> www.example.com.gigalixirdns.com.
See Gigalixir Docs
However, RFC rules says that a root level (apex level) CNAME is not allowed. GoDaddy does not allow this – so GoDaddy is not a good registrar for Gigalixir (maybe not a good registrar for anything). But some registrars like namecheap.com allows for an
ALIAS record type that you can use for the root (non-www) version of your domain to solve this problem. Domains registered with Namecheap.com work with Gigalixir.
But for many (most?) registrars
www.example.com works great! But
I tried AWS Route 53, and I am so confused. It says something about “alias” record, but it does not allow me to define an alias the same way as Namecheap… AWS is so confusing. I think what I want to do is very VERY common: you want www.example.com and example.com to point to your web server. Doesn’t almost everybody want this?
I think maybe Route 53 can make an “alias” only if there is an A record already… but if there is an A record, then I do not understand why I would need a CNAME or an ALIAS at all. Maybe not?
So my question is does Gigalixir have a static IP address that I can use in a DNS A record (or AAAA record for ipv6). Or is a static IP address for DNS not allowed in Gigalixir? Does someone have a custom domain working for both www and root/apex domain using Route 53?
Thank you for any informations.
Afaik Heroku uses the exact same system coming with the same limitations/hurdles. Maybe you can find some tutorial related to heroku, which can help you.
We (gigalixir) don’t usually recommend using an A record just on the off chance that we are forced into changing our ip addresses, but we’ve never had to so far and don’t see any real reason why we ever would so I think it’s relatively safe to use an A record if you have to. Just use
dig or https://toolbox.googleapps.com/apps/dig/ and find the ip address of your example.com.gigalixirdns.com record and use that. Let me know if you run into any problems.
To be honest, though, what I would do is set up a redirect from the apex to www as I think most DNS providers support that sort of thing and it’s good practice to have a canonical hostname.
Thank you for the information!
Unfortunately, setting up a redirect for the apex/root domain is not simple, and many (most?) registrars do not allow it: GoDaddy and Route53 specifically do not allow this and I think they are maybe the most popular registrars?
I have a follow up question – when you say to use
dig – I can see something like this:
; <<>> DiG 9.10.6 <<>> example.com.gigalixirdns.com.
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 63176
;; flags: qr rd ra; QUERY: 1, ANSWER: 4, AUTHORITY: 0, ADDITIONAL: 1
;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 4096
;; QUESTION SECTION:
;example.com.gigalixirdns.com. IN A
;; ANSWER SECTION:
example.com.gigalixirdns.com. 60 IN CNAME us-east-1.aws.tls.gigalixir.com.
us-east-1.aws.tls.gigalixir.com. 32 IN CNAME abc-f88f3c48c2438c19.elb.us-east-1.amazonaws.com.
abc-f88f3c48c2438c19.elb.us-east-1.amazonaws.com. 32 IN A 126.96.36.199
abc-f88f3c48c2438c19.elb.us-east-1.amazonaws.com. 32 IN A 188.8.131.52
;; Query time: 95 msec
;; SERVER: 192.168.1.1#53(192.168.1.1)
;; WHEN: Thu Aug 20 17:26:37 EDT 2020
;; MSG SIZE rcvd: 219
Do you mean I should create DNS A records for my
example.com domain for both the IP addresses listed under A records?
184.108.40.206 in this example. is that correct?
Again, thank you! Sorry for my not understanding.
Ohh I’m so sorry. I forgot that if you’ve chosen AWS, there really is no way to use an A record. On GCP, you’d be right and there’d only be one ip address there in dig. But with elastic load balancer a the number of IP addresses is dynamic and perhaps not stable.