LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
 
Search this Thread
Old 05-14-2013, 11:36 PM   #1
pedenski
Member
 
Registered: Feb 2012
Posts: 33

Rep: Reputation: Disabled
forwarding DNS query to another DNS server


How to effectively forward DNS query to another DNS server in BIND?

can you look onto this config that i have? as ive been having errors on my /var/log/message

/etc/named.conf
Code:
options {
        directory "/var/named"; // path of the zone files
        forwarders {10.124.1.23;8.8.8.8;}; // DNS forwarders
        listen-on {127.0.0.1; 192.168.8.10; 10.167.95.24;};
        allow-query {127.0.0.1; 192.168.8.0/24; 10.0.0.0/8;};
};

zone "test.com" IN {
        type forward;
        forwarders{10.124.1.23;};
};
What i wanted to achieve is to direct all my query to another corporate DNS when resolving test.com

/var/log/messages
Code:
ns named[30915]: error (host unreachable) resolving 'test.com/A/IN': 10.124.1.23#53

Last edited by pedenski; 05-14-2013 at 11:45 PM.
 
Old 05-14-2013, 11:42 PM   #2
chrism01
Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Centos 6.6, Centos 5.10
Posts: 16,423

Rep: Reputation: 2085Reputation: 2085Reputation: 2085Reputation: 2085Reputation: 2085Reputation: 2085Reputation: 2085Reputation: 2085Reputation: 2085Reputation: 2085Reputation: 2085
It says 'host unreachable' for that ip 10.124.1.23. Its also unusual to have only a 2 level FQDN (Fully Qualified Domain Name). Normally you'd see machine.subdomain.domain.
You need to check the zone file content for the record indicated.
Eg http://www.linuxtopia.org/online_boo...-zone-examples
 
Old 05-15-2013, 01:46 AM   #3
RobertEachus
Member
 
Registered: Dec 2011
Posts: 32

Rep: Reputation: 8
Unreachable is unreachable try running from the DNS server;
dig test.com @10.124.1.23 -b 192.168.8.10
dig test.com @10.124.1.23 -b 10.167.95.24

You may need to set "query-source" in named.conf
 
Old 05-15-2013, 04:30 AM   #4
pedenski
Member
 
Registered: Feb 2012
Posts: 33

Original Poster
Rep: Reputation: Disabled
Quote:
It says 'host unreachable' for that ip 10.124.1.23. Its also unusual to have only a 2 level FQDN (Fully Qualified Domain Name). Normally you'd see machine.subdomain.domain.
You need to check the zone file content for the record indicated.
Eg http://www.linuxtopia.org/online_boo...-zone-examples
i know the FQDN, its actually like test.smart.local

which is actually defined in my named.conf
Code:
zone "test.smart.local" IN {
      type forward;
      forwarders {x.x.x.x;};
};
im really not sure if theres anything lacking. i can access the site (test.smart.local) by using its IP, but not its domain name



Quote:
Originally Posted by RobertEachus View Post
Unreachable is unreachable try running from the DNS server;
dig test.com @10.124.1.23 -b 192.168.8.10
dig test.com @10.124.1.23 -b 10.167.95.24

You may need to set "query-source" in named.conf
im not sure if im getting you right,i tried adding "query-source" on my zone but im getting "unknown option query-source" when i restart

i can ping the DNS 10.124.1.23 but i cannot resolve any domains from it.
forwarders is already set.

do i have to create specific zone file for this? i have only defined the zone in the named.conf
 
Old 05-15-2013, 07:47 AM   #5
chrism01
Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Centos 6.6, Centos 5.10
Posts: 16,423

Rep: Reputation: 2085Reputation: 2085Reputation: 2085Reputation: 2085Reputation: 2085Reputation: 2085Reputation: 2085Reputation: 2085Reputation: 2085Reputation: 2085Reputation: 2085
Of course you have to define a zone file; see my previous link.
Note that in named.conf, you only name the domain or subdomain.domain; the zone file contains the machine recs for that domain.
 
Old 05-16-2013, 12:53 AM   #6
pedenski
Member
 
Registered: Feb 2012
Posts: 33

Original Poster
Rep: Reputation: Disabled
hi, im still struggling to make this work..

i changed the config based on the knowledge that i got from your link

my /etc/named.con
Code:
zone "test" IN {
        type master;
        file "test-fz";
        allow-update{none;};
};
my forward zone file
Code:
@       IN NS   test.corp.local. //this is the corp internal DNS
@       IN A    10.124.6.125
www     IN A    10.124.6.125
#nslookup test
Code:
Server:		127.0.0.1
Address:	127.0.0.1#53

Name:	test
Address: 10.124.6.125
Address: 10.124.6.125 is the correct address.

i run a wireshark and when i try to resolve the `test` domain on my browser i get a reply `no such name`
 
Old 05-16-2013, 08:56 AM   #7
jackstevens
LQ Newbie
 
Registered: May 2008
Posts: 2

Rep: Reputation: 0
Quote:
Originally Posted by pedenski View Post
hi, im still struggling to make this work..

i changed the config based on the knowledge that i got from your link



Address: 10.124.6.125 is the correct address.

i run a wireshark and when i try to resolve the `test` domain on my browser i get a reply `no such name`
You may be looking in the wrong place. What do you have in your /etc/resolv.conf file?

That file will append a domain name to your lookup of "test"

Format is like this, and my instance of CentOS has a man entry for resolv.conf.


Code:
[jstevens@gig etc]$ cat /etc/resolv.conf
# Generated by NetworkManager
search localdomain public.net jackstevens.net
nameserver 127.0.0.1
nameserver 205.171.3.65
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Reverse query on forwarding DNS queries sandeep_hello Linux - Server 8 12-27-2012 10:02 AM
How to query against a DNS server with Windows Client? Plaethos Linux - Networking 4 06-17-2010 08:39 PM
Redirect local DNS query to remote DNS server on non standard port? rock_ya_baby Linux - Server 8 04-13-2010 04:31 AM
Help needed regarding DNS server query myself_rajat Linux - Networking 8 08-16-2004 06:09 AM


All times are GMT -5. The time now is 10:01 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration