raruizmu
By:
raruizmu

My domain works only with www

December 29, 2015 1.2k views
DNS DigitalOcean Ubuntu

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

1 comment
1 Answer

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 @

3) create any additional records as needed
4) test with the following syntax:
dig <hostname> @ns1.digitalocean.com

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

Have another answer? Share your knowledge.