Linux - NetworkingThis forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
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?
Last edited by chinese_ys; 01-10-2013 at 12:59 PM.
?? 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?
?? 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?
I was expecting forward request to itself in order to use /etc/hosts.
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.
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.
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.
I did have the zone for test.com configured the first attempt but did not work as I expected.
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.
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.
Sure that is making sense on paper but can you be more specific?
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
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" {
type master;
file "/etc/bind/zones/test.example.com";
};
with a zone file like:
Code:
$TTL 604800
@ IN SOA test.example.com. (
1 ; Serial
604800 ; Refresh
86400 ; Retry
2419200 ; Expire
604800 ) ; Negative Cache TTL
;
@ IN NS test.example.com.
test.webdomain.com. IN A 10.0.1.20
OK, looking it up a little more, a slight tweak to what I suggested.
...
then you add a ZONE PER HOSTNAME, so a zone for test.example.com and othertest.example.com, not for example.com itself:
...
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.