<div dir="ltr"><div>Hello,<br><br>I want to have a dummy (internal) root NS to resolve specific name <a href="http://hello.test.com">hello.test.com</a> to 4.5.6.7, everything else to 1.2.3.4.<br><br>Using a wildcard does not work as expected (by me), though.<br>
<br>1st attempt:<br><br># cat db.root<br>$TTL 86400<br>@                       IN      SOA     ns1.root.internal. dnsadmin.root.internal. 1 21600 3600 604800 600<br>                        IN      NS      ns1.root.internal.<br>
*                       IN      A       1.2.3.4<br><a href="http://hello.test.com">hello.test.com</a>.         IN      A       4.5.6.7<br># dig +short @localhost <a href="http://hello.test.com">hello.test.com</a><br>4.5.6.7<br>
# dig +short @localhost <a href="http://hello.test.net">hello.test.net</a><br>1.2.3.4<br># dig +short @localhost <a href="http://other.test.com">other.test.com</a><br># dig +short @localhost <a href="http://other.test-it.com">other.test-it.com</a><br>
# dig +short @localhost <a href="http://other.test.org">other.test.org</a><br>1.2.3.4<br># dig +short @localhost <a href="http://other.test.net">other.test.net</a><br>1.2.3.4<br><br>Result: returns NXDOMAIN for anything ending in .com - probably because of <a href="http://hello.test.com">hello.test.com</a>!<br>
<br>2nd attempt:<br><br># cat db.root<br>$TTL 86400<br>@                       IN      SOA     ns1.root.internal. dnsadmin.root.internal. 1 21600 3600 604800 600<br>                        IN      NS      ns1.root.internal.<br>
*                       IN      A       1.2.3.4<br>*.com.                  IN      A       1.2.3.4<br><a href="http://hello.test.com">hello.test.com</a>.         IN      A       4.5.6.7<br># dig +short @localhost <a href="http://hello.test.com">hello.test.com</a><br>
4.5.6.7<br># dig +short @localhost <a href="http://hello.test.net">hello.test.net</a><br>1.2.3.4<br># dig +short @localhost <a href="http://other.test.com">other.test.com</a><br># dig +short @localhost <a href="http://other.com">other.com</a><br>
1.2.3.4<br><br>Result: returns NXDOMAIN for anything matching <a href="http://label1.label2.com">label1.label2.com</a>, works for <a href="http://label1.com">label1.com</a> however. Again existing entry for <a href="http://hello.test.com">hello.test.com</a> seems to override wildcards in an unexcpected way.<br>
<br>3rd attempt:<br><br># cat db.root<br>$TTL 86400<br>@                       IN      SOA     ns1.root.internal. dnsadmin.root.internal. 1 21600 3600 604800 600<br>                        IN      NS      ns1.root.internal.<br>
*                       IN      A       1.2.3.4<br>*.com.                  IN      A       1.2.3.4<br>*.<a href="http://test.com">test.com</a>.             IN      A       1.2.3.4<br><a href="http://hello.test.com">hello.test.com</a>.         IN      A       4.5.6.7<br>
# dig +short @localhost <a href="http://hello.test.com">hello.test.com</a><br>4.5.6.7<br># dig +short @localhost <a href="http://hello.test.net">hello.test.net</a><br>1.2.3.4<br># dig +short @localhost <a href="http://other.test.com">other.test.com</a><br>
1.2.3.4<br># dig +short @localhost <a href="http://other.test-it.com">other.test-it.com</a><br>1.2.3.4<br># dig +short @localhost <a href="http://other.test.org">other.test.org</a><br>1.2.3.4<br># dig +short @localhost <a href="http://other.test.net">other.test.net</a><br>
1.2.3.4<br><br>Result: finally what I wanted<br><br>Any idea why the wildcard matching is affected by the individual levels/labels of <a href="http://hello.test.com">hello.test.com</a>? <br><br>If multiple enties exist in addition to the wildcard the strange behaviour applies to them as well, e.g. I need:<br>
<br># cat db.root<br>$TTL 86400<br>@                       IN      SOA     ns1.root.internal. dnsadmin.root.internal. 1 21600 3600 604800 600<br>                        IN      NS      ns1.root.internal.<br>*                       IN      A       1.2.3.4<br>
*.com.                  IN      A       1.2.3.4<br>*.<a href="http://test.com">test.com</a>.             IN      A       1.2.3.4<br><a href="http://hello.test.com">hello.test.com</a>.         IN      A       4.5.6.7<br>*.bar.            IN    A    1.2.3.4<br>
*.foo.bar.        IN    A    1.2.3.4<br>hello.foo.bar.          IN      A       8.9.10.11<br><br>to resolve specific names <a href="http://hello.test.com">hello.test.com</a> and hello.foo.bar to their respective IPs and everything else to 1.2.3.4.<br>
<br>(DNS-Server version happens to be BIND 9.7.4-P1)<br><br>Regards<br> Tom<br></div><br></div>