1

I've been playing with this for a week, and am kind of given up. I was assigned a task to configure a locally setup DNS on a system, and redirect it to an external DNS to resolve addresses such as google.com.

So for clarification:

System DNS[127.0.0.1] -x-> Intranet DNS[192.168.1.123] ---> WWW

I can do a dig @192.168.1.123 google.com and it returns an answer.
but doing a dig @127.0.0.1 google.com returns 0 answers.

With Centos 6.5, and using named and rpcbind, how can I configure a system DNS to point to an external DNS to find an answer. How would I should I configure /etc/named.conf /var/named/site1.foo.com.zone and any other files to make this redirection? As master, as slave, any benefit to making one or the other, do I have a choice?

Both files mentioned are configurable in the directory /var/named/chroot/...

I would prefer persevering the system DNS in case some hosts have not been removed to the /etc/hosts file.

The following is what I have for /var/named/chroot/var/named/db.site.foo.com

site1.foo.com                  IN SOA sm1.site1.foo.com. root.site1.foo.com. (
                                2010060101      ; Serial YYYYMMDDnn
                                86400           ; Refresh (1 day)
                                7200            ; Retry (2 hours)
                                3600000         ; Expire (5 weeks 6 days 16 hours)
                                172800          ; Minimum (2 days)
)
                                NS              sm1.site1.foo.com.
                                NS              slavedns.site1.foo.com
                                A               127.0.0.1
                                A               192.168.1.123
$ORIGIN site1.foo.com
$TTL 172800 ; 2 days

sm1                             A               127.0.0.1
slavedns                        A               192.168.1.123

being reference by the following zone conf in /var/named/chroot/etc/named.conf:

zone "site1.foo.com" {
     type master;
     file "db.site1.foo.com";
};

How do I finish expanding on this point to get 127.0.0.1's(localhost's) DNS to reach 192.168.1.123 for external answers? I tried multiple ways, and now I'm sure I'm just getting myself more confused. I'm new to DNS, besides the overall basic concepts.

  • You may need to add options { recursion true; } to the named.conf file. But, I thought that was the default. You may need to figure out what's turning it off? – MAP Aug 4 '16 at 1:38
  • @MAP Would it matter I I don't really have access to the internal DNS? Yes, recursion is turned off. Someone may have it originally configured it that way before my time. – Baconbitz Aug 4 '16 at 2:36
  • "I don't really have access to the internal DNS"? I thought that's what you were configuring here. Now I'm really confused. I think there may be something weird about your network setup that I'm not getting from your description. But, if you can turn on recursion, that's what makes it ask other nameservers for answers so you can resolve, for example, google.com . – MAP Aug 4 '16 at 4:32
  • @IMAP ah, sorry for the confusion. There's just plenty of layers of networks and subnets. I meant the intranet DNS, i do not have access to. I have access to a what's on our system which is an appliance. The Appliance itself has a DNS by legacy means. The appliance DNS is all I can configure, but has no knowledge of any public addresses, but the intranet DNS does, which is where I need to get addresses from. – Baconbitz Aug 4 '16 at 5:13
0

As well as the options { recursion true; } mentioned by MAP (which is required to enable recursion), you can also add an optional forwarders rule in a named.conf file to tell bind which "parent" name-servers to use for resolving domain names it doesn't know.

e.g.

forwarders {
  x.x.x.x; // your ISP's nameserver ip-address
  8.8.8.8; // google's public DNS resolver
};
  • Thanks for the answer, not sure I never came across this. One question though. Is it common for hostnames to be entered in as a forwarder. I mean, to clarify, I have a script that allows a user to enter IP addresses. If I allowed hostnames to be included, in order for that 'new'-foreign hostname to resolve, I would have to add an entry in a zone file, right? @cas – Baconbitz Aug 5 '16 at 20:05
  • forwarders are always specified as IP addresses in bind (see man named.conf). I can't make any sense of your clarification (maybe because i haven't even finished my morning coffee yet). – cas Aug 6 '16 at 1:39
  • Ah, Bottom's up! :) I think I see where my confusion came from. The 'Your.isp.nameserver.ip-address' I did mistaken for a hostname. But after your last comment, I realized the message you were trying to send with four periods and '<dot>ip-address' in the last octet; it was meant to represent an IP-address. Thank you for your help! @cas – Baconbitz Aug 6 '16 at 2:19

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.