I configured my DNS (bind9) to accept every subdomain, using a wildcarded 'A' record :
*.mydomain.tld. IN A xx.xx.xx.xx
I configured Apache to serve some specific subdomains using virtual hosts :
<VirtualHost *:80> ServerName sub1.mydomain.tld ServerAlias sub1.mydomain.tld JkMount / sub1JK JkMount /* sub1JK </VirtualHost>
when I ping from a remote computer on a subdomain configured in apache I get a response. When I ping on a subdomain that is not configured in apache, the host is not found.
I don't understand why apache configuration would affect DNS resolution like this?
I would appreciate any information that helps me understand this.
Thanks a lot.
You can confidently exclude any relation between Apache and BIND, and any relation between ping and either of the two. The problem you describe is rooted somewhere else.
Here's how you can troubleshoot it:
- Query from a remote host your DNS server for the two domains not working:
dig @dns-srv-ip sub1.domain.com and
dig @dns-srv-ip sub2.domain.com
- If your BIND Wildcard configuration is running, they will both return the IP. If not, the problem is in BIND: make sure BIND reads the files you edited.
- (remote) ping uses the DNS resolver configured on the remote host. Check /etc/resolv.conf on the remote host, and use
dig sub1.domain.com and
dig sub2.domain.com to ensure both are resolved. No @dnsip here!
- if sub1 and sub2 do not resolve identically at the remote host, then it's a propagation issue, or a resolver issue.