I create zone file

zone "xxx.com" {
    type master;
    file "/etc/bind/db.xxx.com";
    forwarders{};
};

db.xxx.com

$TTL    604800
@ IN SOA pgdebian.xxx.com. contact.xxx.com.
(20881122 604800 86400 2419200 604800 )

                NS      pgdebian.xxx.com.
pgdebian        A       192.168.0.49        
pgdebian        HINFO   "PII 233 :-)" "Debian Testing"
*               A       127.0.0.1

Now, when I request http://lol.xxx.com BIND9 answers 127.0.0.1 But if I try nslookup xxx.com nslookup says SERVER FAILED.

How to redirect xxx.com to 127.0.0.1?

link|improve this question
feedback

2 Answers

up vote 3 down vote accepted

The wildcard is matching children of xxx.com but not xxx.com proper.

Add this record:

@ A 127.0.0.1

to add 127.0.0.1 as an address for xxx.com itself.

The wikipedia article on wildcard DNS is pretty good: http://en.wikipedia.org/wiki/Wildcard_DNS_record

link|improve this answer
thanks it works :) – red eyes dev Jun 15 '11 at 15:50
feedback

I'm not sure I fully understand your question, but if you are trying to create a wildcard record, you need to change it to

*.xxx.com. A 127.0.0.1

Or set the $ORIGIN accordingly.

link|improve this answer
I didn't read it correctly, Michael is right. My answer is wrong. – faker Jun 15 '11 at 15:46
feedback

Your Answer

 
or
required, but never shown

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