LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 02-20-2016, 12:28 PM   #1
Hmail
LQ Newbie
 
Registered: May 2007
Posts: 19

Rep: Reputation: 0
Bind9 only works local


Hi all,

I am a bit new in this territory, so this is probably an easy issue, but I want to get some knowledge in this area.

I have configured a VPS with Bind as an authoritative DNS server. I have configured one zone, vpsnu.nl, and if I check it on the local machine, I get the proper response with the IP address I configured.

However, once I try to do the same from my home computer, I get an error. This is what happens on the VPS:
Code:
> vpsnu.nl
Server:         127.0.0.1
Address:        127.0.0.1#53

Name:   vpsnu.nl
Address: 95.211.172.130
And this is what happens locally:
Code:
> server ns1.hjts.nl
Default server: ns1.hjts.nl
Address: 95.211.172.130#53
> vpsnu.nl
;; connection timed out; no servers could be reached
When I try to get the a record on mxtoolbox.com, the server reports: "Loop detected! We were referred back to '95.211.172.130'"
Now the IP for the domain and the IP for the nameserver are the same, but is that a problem? And if so, why?

This is my configuration, named.conf.options:
Code:
options {
        directory "/var/cache/bind";
        recursion no;
        allow-transfer { none; };
        listen-on { any; };
        listen-on-v6 { any; };
        allow-query { any; };
};
named.conf.local:
Code:
zone "vpsnu.nl" {
        type master;
        file "/etc/bind/zones/db.vpsnu.nl";
};
and /etc/bind/zones/db.vpsnu.nl:
Code:
;
; BIND data file for local loopback interface
;
$TTL    86400
@       IN      SOA     ns1.hjts.nl. my.email.com. (
                     2015022002         ; Serial
                           3600         ; Refresh
                            900         ; Retry
                        1209600         ; Expire
                           1800 )       ; Negative Cache TTL

; Name servers
        IN      NS      ns1.hjts.nl.    ; master
        IN      NS      ns2.hjts.nl.    ; slave

; A records
@       IN      A       95.211.172.130
www     IN      A       95.211.172.130
If I'm doing something horribly wrong, please let me know, I really want to understand this.

Last edited by Hmail; 02-20-2016 at 12:30 PM. Reason: whoops - email address was visible
 
Old 02-20-2016, 03:55 PM   #2
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 13,164
Blog Entries: 1

Rep: Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032
Quote:
dig vpsnu.nl @95.211.172.130 +tcp

; <<>> DiG 9.10.3-P3 <<>> vpsnu.nl @95.211.172.130 +tcp
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 7500
;; flags: qr aa rd; QUERY: 1, ANSWER: 1, AUTHORITY: 2, ADDITIONAL: 1
;; WARNING: recursion requested but not available

;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 4096
;; QUESTION SECTION:
;vpsnu.nl. IN A

;; ANSWER SECTION:
vpsnu.nl. 86400 IN A 95.211.172.130

;; AUTHORITY SECTION:
vpsnu.nl. 86400 IN NS ns2.hjts.nl.
vpsnu.nl. 86400 IN NS ns1.hjts.nl.

;; Query time: 80 msec
;; SERVER: 95.211.172.130#53(95.211.172.130)
;; WHEN: Sat Feb 20 23:53:12 EET 2016
;; MSG SIZE rcvd: 94
It works using tcp, so you need to open port 53 udp on your server firewall

Regards
 
1 members found this post helpful.
Old 02-21-2016, 03:34 AM   #3
Hmail
LQ Newbie
 
Registered: May 2007
Posts: 19

Original Poster
Rep: Reputation: 0
I knew it should be something simple..
You are right, UDP wasn't even forwarded and probably responding as a DNS resolver for the hosts behind the firewall. I moved the DNS resolver to another machine and indeed, (as I should have known) forwarded both TCP and UDP to this nameserver and everything works as it should.

Thanks a lot!
 
  


Reply

Tags
bind9, debian



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
Need to Use BInd9 as a local DNS server for my Network nickn0ck Linux - Server 7 03-22-2015 08:59 AM
[SOLVED] Bind9: Unable to ping "domain.local" even though there are no apparent errors. chronoloraptor Linux - Server 3 03-28-2013 02:31 AM
bind9: example.com works, www.example.com doesnt, and how to block urls Shwick Linux - Server 6 09-12-2011 12:26 AM
[SOLVED] Bind9 - Works locally, but other name servers not being updated? Scynix Linux - Server 6 05-13-2011 09:14 AM
DNS Server (bind9) works on the private network but not in the public one! wjleon Linux - Networking 26 01-24-2009 08:14 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 11:08 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