DNS question
Hey,
I have a temp DNS server (172.16.0.100) on internal network running openSUSE. There is a special host "host1.test.com" on network that I need internal user to have its private IP when resolving. I created a zone "test.com" in named.conf as redirect and statically added host1.test.com into /etc/hosts file. named.conf: zone "test.com" in { type forward; forwarders { 127.0.0.1; }; }; I also have 8.8.8.8 configured as my upstream forwarder. My issue is Client PC with 172.16.0.100 as DNS server is not able to resolve host1.test.com. I got timeout message. So how should I configure the DNS server to be smart enough to forward request to itself to check /etc/hosts and/or upstream forward when client asks for host on test.com domain? |
forwarders { 127.0.0.1; };
?? you're just telling it to forward to itself, that clearly makes no sense, and would just be an infinite loop. it's really unclear what you're actually asking for. Where does /etc/hosts fit into this? If it's just one client, why bother with DNS at all, just put the entry on the single client surely? |
Quote:
Let me try to explain again: I have multiple clients(WIFI Guests) on this LAN. When they connect to network, I need to have host1.test.com to be resolved as 172.16.0.254 and host2.test.com as 1.2.3.4; When they are on Internet, I need host1.test.com to be resolved as 1.2.3.3 and host2.test.com as 1.2.3.4 (This part has done via godaddy already). Please keep in mind, there are more than host1 and host2 need to be resolvable. Any suggestion? |
Hmm, well firstly no, the 127.0.0.1 ideas are nonsense. a BIND instance will never revert to local files, It's a proper service, not a simple utility like dnsmasq. You'd define a proper BIND zone for it, and put the appropriate A record in the zone file.
|
Quote:
So if I have 50 hosts needs to be resolvable on Internet including this host1.test.com, i would need to manaully add all 50 records into the ZONE configuration? |
If you're forwqarding all other unknown addresses, you'd only need the local entries on the local server, asssuming that this local server plays no part at all in the resolution from the interwebs.
|
Quote:
Here was the one I had initially and it did not work as I expected: named.conf: zone "test.com" in { type master; file "/var/lib/named/master/test.com.hosts"; }; test.com.hosts: $TTL 2D @ IN SOA DNS01.test.com. root.DNS01.test.ca. ( 2011111800 ; serial 3H ; refresh 1H ; retry 1W ; expiry 1D ) ; minimum IN NS DNS01.test.com. vpn IN A 172.16.0.254 My DNS server is the DNS01.test.com. |
OK, looking it up a little more, a slight tweak to what I suggested.
So you have your forwarders set up, so you're resolving all sites to public addresses via your local DNS server. then you add a ZONE PER HOSTNAME, so a zone for test.example.com and othertest.example.com, not for example.com itself: Code:
zone "test.example.com" { Code:
$TTL 604800 |
Quote:
|
All times are GMT -5. The time now is 03:17 PM. |