Adding www. to Domain

Thank you very much for this - I have successfully got it working at the www. by re-running the discourse-setup script as in your article, but now the naked domain no longer works! Is there any way I can make the naked domain work as well - or at least automatically fill in the www.?

So I now have A record linking naked domain to IP address
CNAME record linking www to naked domain

Many thanks!