Forums

Custom Domain and CNAME

I have registered a domain and provided the CNAME, however, it isn't still working. I'm I doing anything incorrectly?

enter image description here

enter image description here

Can I have multiple CNAMEs?

enter image description here

If you want the website available at www.diogothecoder.com, the right CNAME would be

Prefix: 'www', Value: 'webapp-417428.pythonanywhere.com.'

It should look like this, when tested from Linux command line:

$  host www.diogothecoder.com
www.diogothecoder.com is an alias for webapp-417428.pythonanywhere.com.
webapp-417428.pythonanywhere.com has address 34.206.101.184

But right now you have:

$  host _webapp-417428.diogothecoder.com
_webapp-417428.diogothecoder.com is an alias for www.webapp-417428.pythonanywhere.com.
www.webapp-417428.pythonanywhere.com has address 34.206.101.184

Also you'll need to edit (pencil icon) at PA your webapp's name to include the 'www.' prefix!

also on the pythonanywhere webapp page, you want the domain to be www.diogothecoder.com instead of just diogothecoder.com

When I try to change the prefix to be www, I get an error, is it alright if I add an underscore to the beginning of the prefix as the websites wants to?

enter image description here

I'm not sure, why they call this field as a "label", and why many (when it should be one, imho). I think it's somehow related to this:

1and1.com / configuring-a-cname-for-an-existing-subdomain

1and1.com / creating-a-cname-record-for-a-host-name-that-begins-with-an-underscore

I think the culprit is existing A/AAAA record for www. subdomain which blocks you from creating a CNAME with the same name as prefix. Sources: 1, 2

I have decided to end my hosting with 1&1 and have switched to GoDaddy. I am waiting for 1&1 to transfer my domain to my new provider. In the meantime, I have also bought the domain name DiogoTheCoder.co.uk.

Below is the current setup wondering if this is correct?

enter image description here

enter image description here

Changed the webapp domain to www.DiogoTheCoder.co.uk and the website is now working, how do I implement the ability for users to be able to redirect to my website when they type just DiogoTheCoder.co.uk, no www.

You can set that up with GoDaddy -- this is the appropriate help page on their site -- you need to use the "forward to any site" option.

Thanks, @giles, got it working just took a few hours

Glad you got it working :-)

please this is my first time using custom domain, i just bought wyreng.com and i'm oblivious to the configuration. i cant even find the dns webapp.xxxx.pythonanywhere.com. Help please

The CNAME value is shown on your web app configuration page. Make sure you've worked through our documentation on configuring your DNS: http://help.pythonanywhere.com/pages/DNSPrimer/, http://help.pythonanywhere.com/pages/TroubleshootingDNS/ and http://help.pythonanywhere.com/pages/NakedDomains/

yes i've see see the documentation,. but where do i find the cname value 'webapp.xxxx.pythonanywhere.com' to feed my registrar.

Thanks a bunch

On your web app configuration page. At the top.

Thanks, apparently I had to change the webapp name first before it appeared.

Hi, my name is Ibrahim. I need your help. I bought hosting on your server and created a web application and uploaded the site there. I added my domain that I bought on the site reg.ru and so that the site starts working with my domain I added my CNAME on the site and when I enter my site in the search field this entry goes out. Please help me fix this, tell me how this can be changed. Thanks

You're going to need to be more clear about what you did and are trying to do. What search field are you talking about? What entry goes out?

Hello, Will getting a domain name tied to shared hosting of a local slow hosting provider affect the response time of my web app once I am done linking with CNAME.(I need a country specific extension not supported by popular foreign hosting providers)

You can link only one domain to one web app. Also, when your DNS record propagates it does not matter where your domain is hosted.

salut à vous j'ai hebergé mon site chez vous et j'ai acheté le nom de domaine,je suis bloqué lors de la configuration du domaine,pouvez-vous m'aider svp? sur mon serveur de domaine on me demande de configurer le DNS, et je ne sais pas comment je peux le trouver!

Take a look at https://help.pythonanywhere.com/pages/DNSPrimer/

i set up custom domain.My website is at www.customdomain.com but it does not come when i search only customdomain.com without www.what should i do.

I'm not sure what do you mean by "searching" and "coming" in this context. Please check our help page for how to configure naked domain for PythonAnywhere, maybe this is what you need.

Hi

I have configured CNAME in in Godaddy to point to pythonanwyhere app. It appears that change has taken effecte but now I am getting an error that says "Invalid HTTP_HOST header: 'www.buntuzdgi.com'. You may need to add 'www.buntuzdgi.com' to ALLOWED_HOSTS."

I did amend the settings files, but the error persists. ALLOWED_HOSTS = ['buntuzdgi.com', 'https://www.buntuzdgi.com/'], but we still have same issue

You should have "www.buntuzdgi.com" in the ALLOWED_HOSTS list, not "buntuzdgi.com" and not "https://www.buntuzdgi.com/".

Hi

I have changed it and reloaded , it still gives same error: Exception Value:
Invalid HTTP_HOST header: 'www.buntuzdgi.com'. You may need to add 'www.buntuzdgi.com' to ALLOWED_HOSTS.

I havae renamed my application from to Configuration from buntuntozake.pythonanywhere.com to www.buntuzdgi.com.

Now the directories are still showing as buntuntozake/settings.py for example. Do you think this can cause the problem?

This is what I did . 1. I bought the domain and configured CNAM in goddaddy 2. I renamed my application to www.buntuzdgi.com 3. I took the How to point your domain at your websit?. CNAME:webapp-xxxxxx.pythonanywhere.com and used it in go like below 4. CNAME www.buntuzdgi.com webapp-xxxxxx.pythonanywhere.com 1 Hour 5. CNAME www webapp-xxxxxx.pythonanywhere.com 1 Hour

I then reloaded the page, but still with no luck.

Can you advise if I have followed proper processe?

Could we take a look into your files? We can do that, but we alwyas prefer to ask first.

Hi

Yes please go ahead and look at my files.

Regards Buntu

It looks like ALLOWED_HOSTS in the settings.py still has value of ['buntuntozake.pythonanywhere.com'].

Hi

Its set to the correct domain: ALLOWED_HOSTS = ['www.buntuzdgi.com']. I tried to do it in private mode of my web browser, still with no joy. I tried to cache as well, but it still gives same error

I don't see that change in your settings file; here's a direct link to the file in question (it will only work for you, not for other people on the forums).

Also, once you've made the change and saved the file, don't forget to reload it using the green button on the "Web" page inside PythonAnywhere to make your change live.

Hi Giles

Thanks it works now. I realized I had two files with the same name at different locations and I was changing the wrong file.

Regards Buntu

Glad to see that you found the problem!