1

Here is my named.conf:

view    "external"
{

        match-clients           { any; };
        match-destinations      { any; };

        recursion no;

        allow-query-cache { none; };

        include "/etc/named.root.hints";

        zone "domain.com" IN {
                type master;
                file "domain.com";
        };
};

and my domain.com

$TTL 86400
@               IN      SOA     ns1.domain.com.      admin.domain.com. (
                        2010111501
                        28800
                        7200
                        864000
                        86400
                        )
                IN      NS      ns1.domain.com.
                IN      NS      ns2.domain.com.

@                       A       109.228.16.159

$ORIGIN domain.com.

@               IN      A       109.228.16.159
domain.com.  IN      A       109.228.16.159
catch           IN      A       109.228.16.159
mail            IN      A       109.228.16.159

domain.com.  IN      MX      10 mail.domain.com.

ns1             IN      CNAME   catch
ns2             IN      CNAME   catch
www             IN      CNAME   catch
*               IN      CNAME   catch

www.domain.com works fine ashfajkshfjkashfjkahskfjhasjkhfajksf.domain.com works fine domain.com doesn't work

any ideas?

1 Answers1

1

Move $ORIGIN to the top of your file. Remove the second A definition for @ and the A definition for domain.com. You may want to replace the @ definition with IN as follows.

$ORIGIN domain.com.
$TTL 86400
@               IN      SOA     ns1.domain.com.      admin.domain.com. (
                        2010111502
                        28800
                        7200
                        864000
                        86400
                        )
                IN      NS      ns1.domain.com.
                IN      NS      ns2.domain.com.
                IN      A       109.228.16.159

catch           IN      A       109.228.16.159
mail            IN      A       109.228.16.159
... 

Check your logs for messages from bind when you restart it.

BillThor
  • 27,737
  • 3
  • 37
  • 69
  • 1
    Did this actually work? @ should be automatically defined to be the zone being loaded, so the $ORIGIN line should have no effect as it simply sets it again. – Michael Graff Nov 16 '10 at 10:06
  • @michael I believe the $ORIGIN is redundant, but it doesn't hurt. Likely breaks things severely if it doesn't match the domain it is configuring. That may be a good thing. – BillThor Nov 16 '10 at 20:49