I have two domain extensions,
www.mydomain.io. My main domain extension is the
.com so my goal is to redirect all traffic coming from the .io extension to the .com (including HTTPS traffic).
I have set up redirects in my
wordpress_sites.yml to include the second domain :
wordpress_sites: mydomain.com: site_hosts: - canonical: www.mydomain.com redirects: - mydomain.com - www.mydomain.io - mydomain.io ... ssl: enabled: true provider: letsencrypt
In my domain name manager, I created a
DNS A record on each domain (.com and .io) to point to my DigitalOcean droplet IP and also set up the DNS to DigitalOcean’s DNS.
But when I’m trying to re-provision my server I get this error from letsencrypt :
ansible-playbook server.yml -e env=production --tags letsencrypt
Could not access the challenge file for the hosts/domains: mydomain.io. Let’s
Encrypt requires every domain/host be publicly accessible. Make sure that a
valid DNS record exists for mydomain.io and that they point to this server’s
IP. If you don’t want these domains in your SSL certificate, then remove them
site_hosts. See https://roots.io/trellis/docs/ssl for more details.
This comes for sure from a misconfiguration on my domain names’ manager and I am clearly missing a point here but I have no idea what.
When I’m pinging mydomain.io I get :
ping: cannot resolve mydomain.io: Unknown host so it seems the DNS A record is not working. I have made the changes on the DNS 2 days ago so it should be updated by now but still not working.
Is my trellis configuration file properly set ? And how should I configure my DNS records on my second domain extension to make it work ?
Thanks in advance.