BIND9 CNAME/A Records
So, I've got Bind9 running and configured on a router which acts as the DNS for my LAN.
I want to setup so that when I resolve a hostname, it goes to a certain IP. I currently have: Quote:
I can also type in ld and it will resolve to hotmail,com. If I type in home.mydomain,com, it resolve to 10.0.0.1 (Or what ever I set it to), however, if I type in voip.mydomain,com, or any other TLD, or sub-domain, it resolves to what ever my ISP would. So, it's only resolving home.mydomain,com, or what ever else I place in the $ORIGIN correctly. Is there any way to configure BIND9 to do A records, or CNAME records for all domains? Basically, I want it to look in its own internal records, before requesting from the internet, if it can't find a record, then request from ISP. |
Hi,
Using FQDNs followed by the tailing dot in the zone file should work. With just hostname, the record is composed by as hostname.$ORIGIN. So in your case you have records like: voip.home.mydomain,com and so no. For this you should use "mydomain,com" as the zone name in named.conf and no $ORIGIN in the zone file. Regards |
Hey Bathory,
I changed the zone, and the zone file named.conf.local was pointing to. I also changed the name of the zone db file in /etc/bind/zones/master to reflect just mydomain.com (So it was mydomain.com.db). I also commented out the $ORIGIN line in the zone file. I restarted bind9, and then cleared the DNS cache on my Windows machine. I tried pinging voip.mydomain.com on both my Windows machine, and the Linux server. It still resolves to the external IP address. I also tried adding in: Quote:
Not sure where I'm going wrong. Please note, mydomain.com is in place of another domain I currently own. There's a subdomain called voip on it which I setup on the hosting. |
Quote:
Quote:
If you're still in error, please post the new zonefile, along with the zone definition in named.conf. |
Hey Bathory,
I changed it because: Quote:
Quote:
Yes, I'm 100% sure they are. I checked with ipconfig /all I will update the serial number shortly and get back to you. Thanks! |
Some solutions are
1. Restart the named service otherwise the configuration will not get updated. 2. Make sure that the zone file is readable by named user. |
All times are GMT -5. The time now is 10:16 PM. |