LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
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 07-18-2016, 03:22 AM   #1
orrik
LQ Newbie
 
Registered: May 2016
Distribution: Centos
Posts: 10

Rep: Reputation: Disabled
DNS - problem


Hello

I have a problem with the DNS server. I have a public IP address and redirect it to a server in the local network:

Code:
$ F -t nat -A PREROUTING -d 185.38.xxx.yyy j DNAT --to-destination 192.168.0.195
$ F -t nat -A POSTROUTING -s 192.168.0.195 -j SNAT --to-source 185.38.xxx.yyy
The web server on a network is seen at 185.38.xxx.yyy but when I type domain address www.somedomain.org page is not displayed.

Code:
# cat /etc/resolv.conf
domain somedomain.org
nameserver 127.0.0.1
nameserver 192.168.0.195
Code:
# cat /etc/named.conf
options {
********listen-on port 53 {any; };
********directory "/ var / named";
********dump-file "/var/named/data/cache_dump.db";
********statistics-file "/var/named/data/named_stats.txt";
********memstatistics-file "/var/named/data/named_mem_stats.txt";
********allow-query {any; };
********allow-query-cache {localhost; };
********recursion yes;
********dnssec-enable yes;
********dnssec-validation yes;
bindkeys-file "/etc/named.iscdlv.key";
******** managed-keys-directory "/ var / named / dynamic";
};
logging {
******** channel default_debug {
**************** file "data / named.run";
**************** severity dynamic;
******** };
};
zone "." IN {
******** type hint;
******** file "named.ca";
};
include "/etc/named.rfc1912.zones";
include "/etc/named.root.key";

# Zone somedomain.org
zone "somedomain.org" IN {
**** type master;
**** file "/var/named/somedomain.org";
**** allow-query {
******** };
};
zone "195.0.168.192.in-addr.arpa" IN {
**** type master;
**** file "/var/named/195.0.168.192.in-addr.arpa";
**** allow-query {
******** };
};
and yet the zone file and revdns :

Code:
# cat /var/named/somedomain.org
$TTL 3H
@       IN      SOA     s1    root (
                                2               ;; serial
                                3H              ;; refresh
                                15M             ;; retry
                                1W              ;; expiry
                                1D)             ;; minimum
@       IN      NS      s1              
s1      IN      A       192.168.0.195   
@       IN      A       192.168.0.195   
;;
@       IN      NS      dns1            
dns1    IN      A       192.168.0.195   
;;
@       IN      MX      5       email                                         
;;
email   IN      A       192.168.0.195   
www     IN      A       192.168.0.195
Code:
# cat /var/named/195.0.168.192.in-addr.arpa
$TTL 3H
$ORIGIN 195.0.168.192.in-addr.arpa.
@       IN      SOA     dns1    root (
                                2               ;; serial
                                3H              ;; refresh
                                15M             ;; retry
                                1W              ;; expiry
                                1D)             ;; minimum
@               IN      NS      dns1
dns1            IN      A       192.168.0.195
;;
195             IN      PTR     email
195             IN      PTR     dns1
195             IN      PTR     s1
According to me, something kicked in the DNS configuration but I can not find fault...

Code:
 # nslookup somedomain.org
Server:         127.0.0.1
Address:        127.0.0.1#53

** server can't find somedomain.org.somedomain.org: REFUSED
Code:
# dig somedomain.org

; <<>> DiG 9.8.2rc1-RedHat-9.8.2-0.47.rc1.el6 <<>> somedomain.org
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: REFUSED, id: 20748
;; flags: qr rd ra; QUERY: 1, ANSWER: 0, AUTHORITY: 0, ADDITIONAL: 0

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

;; Query time: 0 msec
;; SERVER: 127.0.0.1#53(127.0.0.1)
;; WHEN: Mon Jul 18 10:09:48 2016
;; MSG SIZE  rcvd: 31
Code:
# netstat -lptun
tcp        0      0 192.168.0.195:53            0.0.0.0:*                   LISTEN      4103/named
tcp        0      0 127.0.0.1:53                0.0.0.0:*                   LISTEN      4103/named
...
udp        0      0 192.168.0.195:53            0.0.0.0:*                               4103/named
udp        0      0 127.0.0.1:53                0.0.0.0:*                               4103/named

For any suggestions and I will help immensely grateful.

Regards
orrik
 
Old 07-18-2016, 08:01 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
Quote:
# nslookup somedomain.org
Server: 127.0.0.1
Address: 127.0.0.1#53

** server can't find somedomain.org.somedomain.org: REFUSED
You get a REFUSED answer for the dns, meaning that you're not allowed to query it
You need to allow it in named.conf:
Code:
<-snip->
# Zone somedomain.org
zone "somedomain.org" IN {
 type master;
 file "/var/named/somedomain.org";
 allow-query {127.0.0.1; 192.168.0.0/24; };
};
<-snip->
NB Usually the queries are allowed from everywhere and only recursion is allowed from your hosts/networks
 
1 members found this post helpful.
Old 07-19-2016, 12:59 AM   #3
orrik
LQ Newbie
 
Registered: May 2016
Distribution: Centos
Posts: 10

Original Poster
Rep: Reputation: Disabled
OMG - it's so simple! I did not notice it. Thank you for your help

Regards
orrik
 
Old 07-19-2016, 03:39 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
Glad that I've helped.
You may mark the thread SOLVED from the "Thread Tools" on top of the page.

Regards
 
  


Reply



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
DNS Setup Problem or Godaddy Problem videoman Linux - Networking 1 02-05-2009 04:38 PM
Win2k3 DNS + PFsense DNS Forwarder = No internal DNS resolution Panopticon Linux - Networking 1 11-19-2007 09:59 PM
DNS problem sayantan Linux - Networking 1 04-02-2006 09:44 AM
DNS problem elmedin Linux - Networking 1 04-16-2004 02:08 AM
DNS problem? rort Linux - Networking 3 02-18-2003 05:45 AM

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

All times are GMT -5. The time now is 05:43 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
Open Source Consulting | Domain Registration