7

my bind config

carrie     IN A     192.253.253.4
*.carrie   IN A     192.253.253.6
*.test.carrie IN A  192.253.253.7

execute

nslookup  carrie 
Address: 192.253.253.4

nslookup a.test.carrie
Address: 192.253.253.7

but when I execute nslookup test.carrie

*** Can't find test.carrie: No answer
Flup
  • 7,978
  • 2
  • 32
  • 43
leo
  • 73
  • 3

1 Answers1

10

The wildcard is working fine, which is why a.test.carrie resolves. Your issue is that test.carrie doesn't resolve.

The reason is simply that you haven't got a record for test.carrie.

*.test.carrie matches immediate subdomains of test.carrie, but matches neither test.carrie itself, nor any subdomains of subdomains of test.carrie.

Add another record without the wildcard.

Falcon Momot
  • 25,244
  • 15
  • 63
  • 92
Dan
  • 15,430
  • 1
  • 36
  • 67
  • 1
    why test.carrie dosen`t match wildchard *.carrie – leo Jun 26 '13 at 08:30
  • 1
    @leo I'm pretty sure it's because `*.test.carrie` partially defines `test.carrie`. Does `test2.carrie` resolve? If so, try adding `*.test2.carrie` and see if it breaks. Remember to allow time for your DNS cache to expire for accurate testing. – Dan Jun 26 '13 at 08:33
  • 1
    nslookup test2.carrie Address: 192.253.253.6 after add *.test2.carrie IN A 192.253.253.11 execute nslookup test2.carrie *** Can't find test2.carrie: No answer – leo Jun 26 '13 at 08:37
  • 3
    @leo As I thought, there's your answer. Once you add a wildcarded subdomain, BIND will no longer match that subdomain with the wildcard. This is almost certainly expected behaviour – Dan Jun 26 '13 at 08:42
  • 2
    @Dan Your wording there in the comment is a little off but you're correct. Wildcards match *beneath* the scope of a dot. – Andrew B Jun 26 '13 at 17:21