Question
How to configure Bind9 to work with wildcard domains?
My app allows users to use own domains for their profiles. They should be able to delegate their domains to my ns servers (i.e. ns1.mynsdomain.com, ns2.mynsdomain.com).
So i decided to try Bind9 as a DNS server, but can’t figure out how to configure it properly to work with wildcard domains.
Things i did:
- Added zone:
zone "." {
type master;
file "db.wild";
};
- Added db.wild file with following content:
$TTL 86400
@ IN SOA mynsdomain.com. root.mynsdomain.com. (
100500 ; Serial
604800 ; Refresh
86400 ; Retry
2419200 ; Expire
86400 ) ; Negative Cache TTL
IN NS ns1.mynsdomain.com.
IN NS ns2.mynsdomain.com.
IN A MY_SERVER_IP_ADDRESS
ns1 IN A MY_SERVER_IP_ADDRESS
ns2 IN A MY_SERVER_IP_ADDRESS
*. IN A MY_SERVER_IP_ADDRESS
Now if i try to ping example.com
(which is already delegated to ns1.mynsdomain.com./ns2.mynsdomain.com.), it responds with “cannot resolve example.com: Unknown host”
What’s wrong with my setup?
These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.
×