I've got a domain (example.com
) registered with godaddy and pointed to nameservers hosted by linode. I've got a multisite WordPress install on linode (blogs.com
) and I want to point the domain to a subdomain of the wordpress install (example.com -> example.blogs.com
).
The subdomain of the wordpress install works fine - DNS can find it and I can browse to it. in the linode's DNS manager I've set up a CNAME to make the pointer I referenced above.
Whois shows that the linode nameservers are set for the domain, but DNS can't find any nameserver for example.com.
Am I missing a step, or do I have something misconfigured?
EDIT 1
The answer section of the dig request using one of linode's nameservers is
;; ->>HEADER<<- opcode: QUERY, status: REFUSED, id: 44359
;; flags: qr rd; QUERY: 1, ANSWER: 0, AUTHORITY: 0, ADDITIONAL: 0
The answer section from the dig using my host's nameserver is
;; ->>HEADER<<- opcode: QUERY, status: SERVFAIL, id: 16379
;; flags: qr rd ra; QUERY: 1, ANSWER: 0, AUTHORITY: 0, ADDITIONAL: 0
Same response in the status field if I specify CNAME or just accept the standard A query.
I do not have an A record for that example.com on the linode nameservers; do I need to set that up?
This is a fairly recent change - a few hours ago, so maybe I'm just being impatient? The nameserver changes made at the same time came through pretty quickly. I figured that the CNAME entry would be simultaneous with that; am I wrong in that expectation?
Technically what you're asking for is invalid.
CNAME
conflicts with all other records (with a special exception for DNSSEC records), thus havingCNAME xxxxx
conflicts with theSOA
,MX
,NS
etc records for the domain. My guess is that the reason the domain resolves when you use anA
there and fails when you use CNAME is because the DNS server enforces those restrictions and is unable to process your zone file.Furthermore, based on your response to @xwincftwx's question, it's not clear that getting CNAME to work would do what you want in the first place. A
CNAME
pointing to anA
record is exactly the same as anA
record in the first place. The CNAME is handled entirely internally by the DNS system and the web browser only sees the IP address. In your test with anA
record (let's say 1.2.3.4), the browser connected to1.2.3.4
and asked it for the websiteexample.com
. If that server isn't configured to serve a website forexample.com
it typically serves a default site (in this caseblogs.com
).If you got your domain to work as a
CNAME
, the browser would ask for the IP address ofexample.com
. DNS would see that it is aCNAME
, look upexample.blogs.com
and return1.2.3.4
. The browser would connect to1.2.3.4
and ask it forexample.com
just as it did when it was anA
record.If you want people going to
example.com
to be redirected toexample.blogs.com
then you'll need to set up a basic web server that receives connections toexample.com
and sends a 301 permanent redirect to the browser to tell it go toexample.blogs.com
You cannot use a CNAME for the root record in a zone file (this is prohibited per RFC 1034, read section 3.6.2). You'll need to put in an A record instead that points to the same IP as the target of your CNAME rule.
What is the output of
dig example.com
? If your know your nameserver's IP you can force dig to use your nameserver (dig @nameserver-ip example.com
). If this works, your nameserver is not used for example.com. When did you assign the linode nameservers? Those changes can take time. Especially if your ISP's DNS server caches results...Just looks like that your nameserver isnt running.
Can you check if you name server is running.
ps -aux | grep named
If your nameserver is not running.. start it and check again.
If it isnt started after you started it.. please post the named information of /var/log/daemon and /var/log/messages
grep named /var/log/messages grep named /var/log/daemon
Perhaps it is a misconfiguration in your zone file.
if your nameserver IS RUNNING, please check your named.conf if your zone accept all incomming traffic.
It is not required to include A records of example.com in your zone file but it is recommended to do for DNS checks and whois checks.