LinuxQuestions.org
Register a domain and help support LQ
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 05-29-2007, 03:13 PM   #1
aclarke
LQ Newbie
 
Registered: Feb 2006
Location: Embro, ON Canada
Distribution: Ubuntu, Debian
Posts: 20

Rep: Reputation: 0
Problems setting up DNS for internal servers


Hi. I'm new to DNS and bind. My ISP doesn't support local loopback, and I have a domain I just bought (andrewclarke.ca). I'm hosting this at home, behind a debian-based firewall/router.

The problem is that if I go to andrewclarke.ca or my static IP from within my home network I get a connection refused. My IP returns pings but that's about it. I figured I'd set up bind to resolve *.andrewclarke.ca back to the internal IPs for whatever service I want.

I've managed to get bind to where if I "ping www.andrewclarke.ca" with bind running I get "unknown host". So at least I know I'm doing something partially right. What I want though is for me to get 192.168.16.5 or whatever my internal web server IP is, rather than my public IP which is what I get from my public nameservers.

If anyone has any idea what I'm doing wrong here, I'd really appreciate it.

Thanks,
- Andrew.

named.conf:
Code:
################################################################################
# Logging Configuration
#
logging {
    #
    # Define channels for the two log files
    #
    channel query_log {
        severity info;
        print-time yes;
	file "/etc/bind/query.log" versions 3 size 100M;
    };
    channel activity_log {
        severity info;
        print-time yes;
        print-category yes;
        print-severity yes;
	file "/etc/bind/activity.log" versions 3 size 100M;
    };

    #
    # Send the interesting messages to the appropriate channels
    #
    category queries         { query_log; };

    category default         { activity_log; };
    category xfer-in         { activity_log; };
    category xfer-out        { activity_log; };
    category notify          { activity_log; };
    category security        { activity_log; };

    category update          { activity_log; };
    #category update-security { activity_log; };	# BIND 9.3 only

    #
    # Dump all uninteresting messages
    #
    category network         { null; };
    category lame-servers    { null; };
};

options {
	directory "/var/cache/bind";
	query-source address * port 53;

	forwarders {
		207.179.130.2;
		207.179.130.3;
	};

	listen-on-v6 { any; };
	allow-transfer { any; };
	auth-nxdomain yes;                      # conform to RFC1035
	allow-query { any; };                   # allow anyone to issue queries
	notify yes;                             # disable AA notifies
	
	listen-on {
		192.168.16.1;
		127.0.0.1;
	};
};

zone "." {
	type hint;
	file "/etc/bind/db.root";
};

zone "localhost" {
	type master;
	file "/etc/bind/db.local";
};

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

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

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

zone "andrewclarke.ca" {
	type master;
	file "/etc/bind/ca.andrewclarke.db";
};

zone "16.168.192.in-addr.arpa" {
	type master;
	file "/etc/bind/192.rev";
};
ca.andrewclarke.db
Code:
;
; BIND data file for andrewclarke.ca
;
$TTL    604800
andrewclarke.ca.	IN	SOA	ns1.andrewclarke.ca. root.andrewclarke.ca. (
                     2007052803 ; Serial
                         604800 ; Refresh
                          86400 ; Retry
                        2419200 ; Expire
                         604800); Negative Cache TTL
;
andrewclarke.ca	IN	NS	ns1.andrewclarke.ca
ns1		IN	A	192.168.16.1
luthien	IN	A	192.168.16.2
www	IN	CNAME	192.168.16.2
192.rev
Code:
;
; BIND reverse data file for 192.168.16.0
;
@	IN      SOA	andrewclarke.ca.	root.andrewclarke.ca.	(
	2007052901	; Serial
	604800	; Refresh
	86400	; Retry
	2419200	; Expire
	604800	)	; Default TTL
;
IN	NS	ns1.andrewclarke.ca.

2	IN	PTR	www.andrewclarke.ca.
1	IN	PTR	dns.andrewclarke.ca.
17	IN	PTR	mail.andrewclarke.ca.
 
Old 05-29-2007, 05:55 PM   #2
scowles
Member
 
Registered: Sep 2004
Location: Texas, USA
Distribution: Fedora
Posts: 620

Rep: Reputation: 31
Take a look at:

1) NS record in zone file for andrewclarke.ca.
2) TTL, SOA and NS records in zone file for 16.168.192.in-addr.arpa

Hint: Tailing dot (period)

Further reading: man named-checkzone and named-checkconf
 
Old 05-29-2007, 06:51 PM   #3
aclarke
LQ Newbie
 
Registered: Feb 2006
Location: Embro, ON Canada
Distribution: Ubuntu, Debian
Posts: 20

Original Poster
Rep: Reputation: 0
Thank You Thank You!

After puzzling through and parsing your somewhat cryptic response, I did some further searching and finally after hours--no, days--of frustration, I have this working!

I've been wanting to be able to do this for the last couple years, so I am SO PSYCHED to finally have this working. Even if I don't have it totally "figured out" yet.

For anyone's edification, this is what I have in ca.andrewclarke.db now:

Code:
; BIND db file for andrewclarke.ca

$TTL 86400

@       IN      SOA     ns1.everydns.net.      root.andrewclarke.ca. (
                        2007053001	; serial number YYMMDDNN
                        28800           ; Refresh
                        7200            ; Retry
                        864000          ; Expire
                        86400           ; Min TTL
			)

                NS      ns1.everydns.net. 
                NS      ns2.everydns.net. 

                MX      10 mail.andrewclarke.ca.

	IN	A	192.168.16.1
www	IN	A	192.168.16.2
test18	IN	A	192.168.16.18

$ORIGIN andrewclarke.ca.
I'll look later more into what else I probably did wrong, and what some of the other settings mean, but I didn't realize that I was supposed to refer to the DNS servers of record in here. I thought I needed to refer to my own internal DNS server, which I guess I wasn't supposed to do.

Thanks again,
- Andrew.

Last edited by aclarke; 05-29-2007 at 06:53 PM.
 
  


Reply

Tags
bind, bind9, dns


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
Setting up DNS Servers properly? Swakoo Linux - Networking 36 02-21-2007 03:19 AM
Prevent dhclient from setting default GW and DNS servers carlosruiz Linux - Networking 1 06-30-2006 01:05 AM
DNS, ROOT servers, and setting up a small personal server urquanmaster Linux - Networking 4 03-10-2005 03:47 AM
Setting DNS servers Boudewijn Linux - Networking 1 12-25-2003 02:56 PM
Info on setting up internal web/dns caching server. l0f33t Linux - Networking 1 05-25-2003 09:42 AM


All times are GMT -5. The time now is 07:02 AM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration