Sign up ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

I recently setup bind on CentOS and want to redirect the non-www to www part of the site.

Currently the www works, but when I try the bare domain from Safari I get: Can't open because the server can't find

My zone file looks like this: (without the $TTL part below)

                IN NS
                IN A          [ip here]

      ns1       IN A          [ip here]

      @         IN MX 10
      @         IN MX 20

      *         IN CNAME      [ip here]

IntoDNS reports at "WWW A Record" section:

ERROR: I could not get any A records for!

When I try * IN A [ip] I get the following error:

      Stopping named:                                            [  OK  ]
      Starting named: 
      Error in named configuration:
      zone localhost/IN: loaded serial 42
      dns_master_load: /var/named/ * CNAME and other data
      zone loading from master file /var/named/ failed: CNAME and other data
      zone not loaded due to errors.
      _default/ CNAME and other data

But IN A [ip] - without * - works (as it was above).

share|improve this question
I'm neither a Bind expert nor did I work with wildcards before, but CNAME to [ip here] looks wrong, CNAMES don't point to IPs, try 'A' instead of 'CNAME' ? – Gryphius Aug 5 '12 at 7:14
@Gryphius: Thanks, tried that but doesn't seem to work. – Lee Aug 5 '12 at 7:54
"It doesn't work at all" is not a very good problem description. What happens when you try to resolve? Do you get an IP address? – David Schwartz Aug 5 '12 at 8:02
@DavidSchwartz Thanks. I've tried what you've suggested and updated my post. Safari simply doesn't load the non-www of the domain, while with www works. (also added in my post now) – Lee Aug 5 '12 at 8:18
@Max: Your post said you had a CNAME. We are suggesting using an A record. "dns_master_load: /var/named/ * CNAME and other data" You shouldn't be using a CNAME. – David Schwartz Aug 5 '12 at 8:22

2 Answers 2

up vote 0 down vote accepted

To make resolve to an IP address, add an A record for @.

@               IN      A
share|improve this answer
Yep, did that eventually and after propagating properly it worked. Thanks! – Lee Aug 5 '12 at 17:15

DNS doesn't work like that. CNAMEs map names to other names, not addresses; A records map names to addresses.

share|improve this answer
Also tried with * IN CNAME, IN A [ip]. Nothing seemed to work. – Lee Aug 5 '12 at 7:51
Try * IN A [ip]. If that doesn't work, please explain precisely what goes wrong when you do it. (Don't forget to bump the serial number and tell your name server that you've changed the zone.) – David Schwartz Aug 5 '12 at 8:01
I think you mean @, not *. I doubt he wants a catch-all. – Michael Hampton Aug 5 '12 at 16:20

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.