Question

My domain works only with www

Hello. My domain is rafael-ruiz.es

I tried to modify the file /etc/hosts by adding my my ip + rafael-ruiz.es I configured the file /etc/apache2/sites-available/000-default.conf to put:

ServerName rafael-ruiz.es

and my correct DocumentRoot

My DNS are correct and this is my domain configuration:

http://snag.gy/p28J3.jpg

What else do I have to do?

Thank you

Show comments

Submit an answer

This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

Sign In or Sign Up to Answer

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Want to learn more? Join the DigitalOcean Community!

Join our DigitalOcean community of over a million developers for free! Get help and share knowledge in Q&A, subscribe to topics of interest, and get courses and tools that will help you grow as a developer and scale your project or business.

Hello,

The issue you are facing is that you added www.rafael-ruiz.es as your DNS zone instead of rafael-ruiz.es. This causes lookups to rafael-ruiz.es to fail with SERVFAIL errors but allows www.rafael-ruiz.es to work without issue.

a% dig rafael-ruiz.es

; <<>> DiG 9.8.3-P1 <<>> rafael-ruiz.es ;; global options: +cmd ;; Got answer: ;; ->>HEADER<<- opcode: QUERY, status: SERVFAIL, id: 54863 ;; flags: qr rd ra; QUERY: 1, ANSWER: 0, AUTHORITY: 0, ADDITIONAL: 0

;; QUESTION SECTION: ;rafael-ruiz.es. IN A

% dig www.rafael-ruiz.es

; <<>> DiG 9.8.3-P1 <<>> www.rafael-ruiz.es ;; global options: +cmd ;; Got answer: ;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 34211 ;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 0

;; QUESTION SECTION: ;www.rafael-ruiz.es. IN A

;; ANSWER SECTION: www.rafael-ruiz.es. 1799 IN A 46.101.65.234

In order to fix this issue, please login to your web account and delete the www.rafael-ruiz.es zone and re-create it as follows:

  1. create rafael-ruiz.es zone
  2. add the following records: @ A 46.101.65.234 www CNAME @ test CNAME @
  • CNAME @
  1. create any additional records as needed
  2. test with the following syntax: dig <hostname> @ns1.digitalocean.com

Please note our platform uses a BIND9 like syntax for its zone files.