3

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?

1
  • Work backwards a little. First ensure the A record that your CNAME points to works first. Fix that and your CNAME should also work. Aug 26, 2012 at 21:57

4 Answers 4

5

Technically what you're asking for is invalid. CNAME conflicts with all other records (with a special exception for DNSSEC records), thus having CNAME xxxxx conflicts with the SOA, MX, NS etc records for the domain. My guess is that the reason the domain resolves when you use an A 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 an A record is exactly the same as an A 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 an A record (let's say 1.2.3.4), the browser connected to 1.2.3.4 and asked it for the website example.com. If that server isn't configured to serve a website for example.com it typically serves a default site (in this case blogs.com).

If you got your domain to work as a CNAME, the browser would ask for the IP address of example.com. DNS would see that it is a CNAME, look up example.blogs.com and return 1.2.3.4. The browser would connect to 1.2.3.4 and ask it for example.com just as it did when it was an A record.

If you want people going to example.com to be redirected to example.blogs.com then you'll need to set up a basic web server that receives connections to example.com and sends a 301 permanent redirect to the browser to tell it go to example.blogs.com

1
  • very cogent explanation of what's going on; thanks!
    – cori
    Aug 26, 2012 at 22:12
4

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.

0

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...

1
  • If some changes came through, all of them should have come through. I'm not sure about the need for an A record. My mistake with a CNAME record was the missing tailing ".". So @ IN CNAME example.blogs.com.. But the SERVFAIL does not seem right (as well as "REFUSED"). The SERVFAIL problem is mentiond [here](www.linuxquestions.org/questions/linux-server-73/bind9-dig-x-returns-status-servfail-643191/c), the REFUSED problems also points to wrong configuration of the nameserver. As if you were not allowed to query.
    – Jens
    Aug 26, 2012 at 16:49
0

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.

1
  • I should have been more explicit; I'm using Linode's nameservers (ns[1-4].linode.com) and their DNS manager. Their servers are running, the zone files pass a check and have the trailing "." Moreover, when I do add an 'A' record for example.com, nslookup finds it within 15 minutes. Of course then example.com is pointed to blogs.com, not example.blogs.com.
    – cori
    Aug 26, 2012 at 18:40

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .