LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 11-03-2011, 12:21 AM   #1
mman12
LQ Newbie
 
Registered: Nov 2011
Posts: 4

Rep: Reputation: Disabled
quick question about the dig command and FQDNs


I'm attempting to configure a DNS server using google as my FQDN forwarder. (8.8.8.8 or 8.8.4.4) I believe I've configured everything correctly but since this is my first time attempting this via linux I'm not entirely certain everything is working properly.

My primary concern is whether the server is resolving queries through google or not. I've read that the dig command could be used to determine this, but I cant figure out exactly how.

Would someone be able to tell me how I can be certain that my server is checking name resolution queries with google by using dig or any other command please?
 
Old 11-03-2011, 01:22 AM   #2
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 13,163
Blog Entries: 1

Rep: Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032
Hi,

You can see the resolver in the dig output, e.g:
Code:
dig linuxquestions.org

; <<>> DiG 9.8.1 <<>> linuxquestions.org
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 36062
;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 0

;; QUESTION SECTION:
;linuxquestions.org.            IN      A

;; ANSWER SECTION:
linuxquestions.org.     1440    IN      A       75.126.162.205

;; Query time: 96 msec
;; SERVER: 8.8.8.8#53(8.8.8.8)
;; WHEN: Thu Nov  3 08:21:34 2011
;; MSG SIZE  rcvd: 52
Regards
 
Old 11-03-2011, 07:22 AM   #3
mman12
LQ Newbie
 
Registered: Nov 2011
Posts: 4

Original Poster
Rep: Reputation: Disabled
Thank you Bathory, this is exactly what I needed, but now I have a new problem. My server is definitely not using google to resolve queries.

I originally believed that configuring the forwarders, in the etc/bind/named.conf.options, to 8.8.8.8 and/or 8.8.4.4 file would allow resolution through goole, but apparently not.

I've experimented a little, and now wonder if changing the nameserver line in the etc/resolv.conf to google's address would get everything working. Any ideas?
Would it just be easier for me to upload my code and let you dissect it at this point?
 
Old 11-03-2011, 08:03 AM   #4
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 13,163
Blog Entries: 1

Rep: Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032
Quote:
I've experimented a little, and now wonder if changing the nameserver line in the etc/resolv.conf to google's address would get everything working. Any ideas?
We are talking for 2 different things:
In my post above I assumed that you want to use google as a resolver, i.e. use its namerver(s) in /etc/resolv.conf
If you want to use google as a forwarder for your nameserver, you need to add its namerver(s) in the forwarders option in named.conf and also use
Code:
forward only;
Note that in this case the answer will come from your dns. You can achieve the same without forwarders, if you configure your server as a caching dns (using the hint zone).

Quote:
Would it just be easier for me to upload my code and let you dissect it at this point?
Feel free to do so if you want, but you have to explain what exactly are you trying to do with your nameserver.

Regards
 
Old 11-03-2011, 05:37 PM   #5
mman12
LQ Newbie
 
Registered: Nov 2011
Posts: 4

Original Poster
Rep: Reputation: Disabled
I'm so sorry, you're right. I was confusing terminology. I did a little more research, and what I'm trying to do is configure my DNS server to forward to google. Eventually I would like to host my zone, but that's a project for another day. At the moment what I really want to know is how do I find proof that queries are being forwarded?

I may have messed something else up for all I know, so here are my configurations.

(resolv.conf)
# Generated by NetworkManager
domain localdomain
search myzone.org
nameserver 192.168.8.2



(db.192.168.0)
;
$TTL 604800
0.168.192.in-addr.arpa. IN SOA ns1.myzone.org. admin.myzone.org. (
1;
3h;
1h;
1w;
1h );
;
0.168.192.in-addr.arpa. IN NS ns1.myzone.org.

10.0.168.192.in-addr.arpa. IN PTR myzone.org.



(db.myzone.org)
;
$TTL 3h
@ IN SOA ns1.myzone.org. admin.myzone.org. (
1;
3h;
1h;
1w;
1h );
;
@ IN NS ns1.myzone.org.
myzone.org. IN MX 10 mail.myzone.org.
myzone.org. IN A 192.168.0.10
ns1 IN A 192.168.0.10
www IN CNAME myzone.org.
mail IN A 192.168.0.10
ftp IN CNAME myzone.org.



(named.conf.options)
options {
directory "/var/cache/bind";
//
forwarders {
8.8.8.8;
};
auth-nxdomain no; # conform to RFC1035
listen-on-v6 { any; };
};



(named.conf.local)
//
zone "myzone.org" {
type master;
file "/etc/bind/zones/master/db.myzone.org";
};

zone "0.168.192.in-addr.arpa" {
type master;
file "/etc/bind/zones/master/db.192.168.0";
};


I don't expect some one to write the whole server for me, or even spell check it, but I greatly appreciate any help offered.
 
Old 11-03-2011, 06:28 PM   #6
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 13,163
Blog Entries: 1

Rep: Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032
You should add a
Code:
forward first;
option if you want to run your own authoritative server along with forwarding queries.

Quote:
At the moment what I really want to know is how do I find proof that queries are being forwarded?
You can use tcpdump.
First run:
Code:
tcpdump -w dns.pcap -i eth0 port 53
and do some queries to your dns (e.g. dig linuxquestions.org, dig google.com etc) to capture some packets, stop the command above and read the captured packets:
Code:
tcpdump -n -r dns.pcap
You'll see something like the following proving that your dns forwards queries to 8.8.8.8
Quote:
reading from file dns.pcap, link-type EN10MB (Ethernet)
01:20:30.390190 IP 192.168.254.1.2528 > 8.8.8.8.53: 52735+ [1au] A? linuxquestions.org. (47)
01:20:30.473711 IP 8.8.8.8.53 > 192.168.254.1.2528: 52735 1/0/1 A 75.126.162.205 (63)
01:20:35.926546 IP 192.168.254.1.40859 > 8.8.8.8.53: 7108+ [1au] A? google.com. (39)
01:20:36.015160 IP 8.8.8.8.53 > 192.168.254.1.40859: 7108 6/0/1 A 209.85.148.106, A 209.85.148.99, A 209.85.148.147, A 209.85.148.103, A 209.85.148.105, A 209.85.148.104 (135)
 
Old 11-03-2011, 09:51 PM   #7
mman12
LQ Newbie
 
Registered: Nov 2011
Posts: 4

Original Poster
Rep: Reputation: Disabled
IT WORKS!!!, quite well in fact. Thank you very much Bathory, I couldn't of done it without your help.
 
  


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
[SOLVED] Quick, simple, shell command question JoshConsulting Linux - Newbie 8 06-03-2010 06:13 PM
quick question on order of operation with command substitution dsollen Linux - Newbie 3 09-15-2009 08:04 AM
quick question on emailing from the command line boyd98 Linux - General 2 04-29-2007 09:38 PM
quick question about the who command AmphetaminePhreak Linux - Newbie 7 08-01-2006 05:07 AM
'dig' command Swakoo Linux - Newbie 7 07-20-2005 10:47 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 08:43 AM.

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
Open Source Consulting | Domain Registration