LinuxQuestions.org
Visit Jeremy's Blog.
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-08-2004, 10:24 AM   #1
khurtwilliams
LQ Newbie
 
Registered: Apr 2004
Location: Princeton
Distribution: Red Hat Linux ES 3
Posts: 8

Rep: Reputation: 0
Home DNS Server


I want to setup a home dns server. I have a server (Fedora Core 1) with static ip address and bind installed. I have three DHCP clients (Fedora Core 1 and Windows XP) which get ip addresses from a LinSys wireless router/firewall.

I have the following in /etc/named.boot
Quote:
primary williams.local named.williams
primary 0.0.127.in-addr.arpa named.local
directory /var/named/
and the following in /etc/named.conf
Quote:
zone "williams.local" {
type master;
file "named.williams";
};
and the following in [code]/var/named/named.williams
Quote:
;This is a comment. I Love comments.
;
; SOA Record williams.local

; Times in seconds.
@ IN SOA cypher.williams.local (
199509010 ; serial number. This is the date: YYYYMMDD
; plus an extra digit, usually zero.
; If you change the file, change the serial
; number. If you change it more than once in a day
; change the last digit.
86400 ; refesh after 24 hours
3600 ; retry after 1 hour
604800 ; expire after 1 week
86400 ) ; minimum TTL of 1 day

; Name servers for williams.local
; This should be the exact same info as was supplied to the InterNIC

IN NS williams.local

; Domain and MX Records
; Change 192.168.1.7 to the IP number for the machine that
; is to be called williams.local
; If no machine will have that name, remove the line.
; IN A 192.168.1.7

; where should we send mail?
; To have mail for williams.local go to eqe.williams.local instead, uncomment
; the next line.
; IN MX 5 eqe.williams.local


; canonical names
; This is where you assign host names to specific IP numbers.
; If this file is on the machine whose IP number replaced
; the 192.168.1.7 above, then uncomment the next two lines
localhost IN A 127.0.0.1
loghost IN A 127.0.0.1
; Replace 192.168.1.7 with a valid IP number on your network.
; The following line assigns the hostname "cypher" to an IP number.
cypher IN A 192.168.1.7
agentsmith IN A 192.168.1.129

; aliases
; Machines can have more than one name.


; host info
; This is purely optional. Broadcasts info about specific host names.

cypher.williams.local. IN HINFO Linux
and finally the following in my /etc/resolv.conf
Quote:
search williams.local
nameserver 192.168.1.7
nameserver 151.197.0.38
nameserver 151.197.0.39
nameserver 192.76.85.133
I can find machine external to my network (eg. google.com) but I am not able to ping the HOSTNAMES of the local machines or do nslookups on them.

What have I done wrong?
 
Old 05-08-2004, 11:04 AM   #2
Pete M
Member
 
Registered: Aug 2003
Location: UK
Distribution: Redhat 9 FC 3 SUSE 9.2 SUSE 9.3 Gentoo 2005.0 Debian Sid
Posts: 657

Rep: Reputation: 30
khurtwilliams

I used this article to set up my home dns server, works perfectly

http://www.linuxgazette.com/issue44/pollman/dns.html


Hope this helps

Pete
 
Old 05-09-2004, 11:50 AM   #3
peecee
LQ Newbie
 
Registered: May 2004
Location: Williamsville, NY
Distribution: Debian, RH, Gentoo
Posts: 1

Rep: Reputation: 0
I've followed the dns how-to suggested and for some reason things don't work quite right. I have almost the same setup as the original poster. I'm trying to see what may be causing that problem, but I've got one of my own in the meantime. Hopefully this ascii art will turn out ok...

internet <----> firewall (linux iptables) <---> switch <------> dns server (linuxserver1)
|<--------> file server (linuxserver2)
|<---------> workstation (linuxws1)
|<---------> workstation (windowsxpws1)
|<---------> workstation (windowsxpws2)

So, basically I've got 4 linux machines (firewall, dns server, files server, workstation) and
2 windows xp pro workstations.

All machines are dhcp to the dns server, and that works just fine. My problem is that the dns server doesn't want to forward queries out to the dns servers listed in the fowarders section of named.conf. My options section looks like this:

forward first;
forwarders {
x.x.x.x;
x.x.x.x;
};
query-source address * port 53;
listen-on {
x.x.x/24;
};
allow-query { x.x.x/24; localhost; };
allow-recursion { x.x.x/24; localhost; };


The x.x.x.x in forwarders are valid DNS servers from my ISP. The x.x.x is the subnet where I allow valid queries from.

The dns server can answer local (no public ones) queries from any linux machine, but when I try to do a dig on something like www.cnn.com, the query times out. The dns server itself can resolve public dns only when the isp dns servers are listed in resolv.conf. When I remove them (relying on the forwarders in named.conf), the request times out.

Any help is really appreciated.

Paul
 
Old 05-10-2004, 06:35 AM   #4
khurtwilliams
LQ Newbie
 
Registered: Apr 2004
Location: Princeton
Distribution: Red Hat Linux ES 3
Posts: 8

Original Poster
Rep: Reputation: 0
I followed the instruction on that page but get errors when starting bind.


Code:
May 10 07:33:06 cypher named[13304]: starting BIND 9.2.2-P3 -u named
May 10 07:33:06 cypher named[13304]: using 1 CPU
May 10 07:33:06 cypher named[13304]: loading configuration from '/etc/named.conf'
May 10 07:33:06 cypher named: named startup succeeded
May 10 07:33:06 cypher named[13304]: no IPv6 interfaces found
May 10 07:33:06 cypher named[13304]: listening on IPv4 interface lo, 127.0.0.1#53
May 10 07:33:06 cypher named[13304]: listening on IPv4 interface eth0, 192.168.1.7#53
May 10 07:33:06 cypher named[13304]: command channel listening on 127.0.0.1#953
May 10 07:33:06 cypher named[13304]: dns_rdata_fromtext: db.localhost:6: near eol: unexpected end of input
May 10 07:33:06 cypher named[13304]: zone 0.0.127.IN-ADDR.ARPA/IN: loading master file db.localhost: unexpected end of input
May 10 07:33:06 cypher named[13304]: dns_rdata_fromtext: db.1.168.192:6: near eol: unexpected end of input
May 10 07:33:06 cypher named[13304]: zone 1.168.192.IN-ADDR.ARPA/IN: loading master file db.1.168.192: unexpected end of input
May 10 07:33:06 cypher named[13304]: dns_rdata_fromtext: db.williams:6: near eol: unexpected end of input
May 10 07:33:06 cypher named[13304]: zone williams.local/IN: loading master file db.williams: unexpected end of input
May 10 07:33:06 cypher named[13304]: running
My file contains:
Code:
db.cache
; <<>> DiG 9.2.2-P3 <<>> @e.root-servers.net . ns
;; global options:  printcmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 23354
;; flags: qr aa rd; QUERY: 1, ANSWER: 13, AUTHORITY: 0, ADDITIONAL: 13

;; QUESTION SECTION:
;.                              IN      NS

;; ANSWER SECTION:
.                       518400  IN      NS      M.ROOT-SERVERS.NET.
.                       518400  IN      NS      I.ROOT-SERVERS.NET.
.                       518400  IN      NS      E.ROOT-SERVERS.NET.
.                       518400  IN      NS      D.ROOT-SERVERS.NET.
.                       518400  IN      NS      A.ROOT-SERVERS.NET.
.                       518400  IN      NS      H.ROOT-SERVERS.NET.
.                       518400  IN      NS      C.ROOT-SERVERS.NET.
.                       518400  IN      NS      G.ROOT-SERVERS.NET.
.                       518400  IN      NS      F.ROOT-SERVERS.NET.
.                       518400  IN      NS      B.ROOT-SERVERS.NET.
.                       518400  IN      NS      J.ROOT-SERVERS.NET.
.                       518400  IN      NS      K.ROOT-SERVERS.NET.
.                       518400  IN      NS      L.ROOT-SERVERS.NET.

;; ADDITIONAL SECTION:
M.ROOT-SERVERS.NET.     3600000 IN      A       202.12.27.33
I.ROOT-SERVERS.NET.     3600000 IN      A       192.36.148.17
E.ROOT-SERVERS.NET.     3600000 IN      A       192.203.230.10
D.ROOT-SERVERS.NET.     3600000 IN      A       128.8.10.90
A.ROOT-SERVERS.NET.     3600000 IN      A       198.41.0.4
H.ROOT-SERVERS.NET.     3600000 IN      A       128.63.2.53
C.ROOT-SERVERS.NET.     3600000 IN      A       192.33.4.12
G.ROOT-SERVERS.NET.     3600000 IN      A       192.112.36.4
F.ROOT-SERVERS.NET.     3600000 IN      A       192.5.5.241
B.ROOT-SERVERS.NET.     3600000 IN      A       192.228.79.201
J.ROOT-SERVERS.NET.     3600000 IN      A       192.58.128.30
K.ROOT-SERVERS.NET.     3600000 IN      A       193.0.14.129
L.ROOT-SERVERS.NET.     3600000 IN      A       198.32.64.12

;; Query time: 172 msec
;; SERVER: 192.203.230.10#53(e.root-servers.net)
;; WHEN: Mon May 10 07:17:04 2004
;; MSG SIZE  rcvd: 436


[root@cypher named]# cat db.1.168.192
N    SOA  cypher.williams.local. (
                  1;
                  10800;
                  3600;
                  604800;
                  86400 );

         IN NS  cypher.williams.local.
10       IN PTR cypher.williams.local.
11       IN PTR neberkenezer.williams.local.

[root@cypher named]# cat db.127.0.0
@ IN SOA   cypher.williams.local. (
                        1;
                        10800;
                        3600;
                        604800;
                        86400 );


  IN  NS localhost.
1 IN PTR localhost.

[root@cypher named]# cat db.williams
@  IN SOA cypher.williams.local. (
   1;
   10800;
   3600;
   604800;
   86400 );

       IN NS   cypher.williams.local.
master IN A    192.168.1.7
localhost    IN A    127.0.0.1
neberkenezer IN A  192.168.1.5

[root@cypher named]# cat /etc/named.conf
options {
 directory "/var/named";

 forwarders {
  151.197.0.38;
  151.197.0.39;
 };

 };


zone "." {
 type hint;
 file "db.cache";
};

zone "williams.local" {
 type master;
 file "db.williams";
};

zone "1.168.192.IN-ADDR.ARPA" {
 type master;
 file "db.1.168.192";
};

zone "0.0.127.IN-ADDR.ARPA" {
 type master;
 file "db.localhost";
};
Quote:
Originally posted by Pete M
khurtwilliams

I used this article to set up my home dns server, works perfectly

http://www.linuxgazette.com/issue44/pollman/dns.html


Hope this helps

Pete
 
Old 05-10-2004, 08:47 AM   #5
khurtwilliams
LQ Newbie
 
Registered: Apr 2004
Location: Princeton
Distribution: Red Hat Linux ES 3
Posts: 8

Original Poster
Rep: Reputation: 0
I got it working!!! Whohooo!

I had an error on one line. One line!!!!!

Thanks for all your help.

Next question. Do I need to serve DHCP off the samer linux server to get my DHCP enabled client registered in the DNS? Currently they I use the LinkSys DHCP server.
 
Old 06-05-2004, 11:37 AM   #6
larva828
LQ Newbie
 
Registered: Mar 2004
Location: Upper Midwest, USA
Distribution: Slack, FC2,
Posts: 7

Rep: Reputation: 0
Yeah man...

I did everything per instructions on the www.linuxgazette.com/issue44/pollman/dns.html article, substituting my ip's and name .

Everything seems to be working so far, since i can ping www my-name org from my computers on my network. However, i try pinging www my-name org from an outside computer and nothing worked.. I could, however, ping ip# or type in mozilla ip# and get my web server.

so my question is this: how can i setup my linux box so that i can type or ping
www my-name org from outside computer and get my linux box?

my home network is this:
---------------linux(fc2) (192.168.0.2)
------broadband---->netgear router (ip#)------|--------------pc(xp) (192.168.0.3)
---------------laptop(xp) (192.168.0.10)


here are my files:
----------------------------- /etc/named.conf
options {
directory "/var/named";

forwarders {
###.###.###.#; --> these are my broadband's nameserver's ip address
###.###.###.###;
};

};

zone "." {
type hint;
file "db.cache";
};

zone "my-name.org" {
type master;
file "db.my-name";
};

zone "0.168.192.IN-ADDR.ARPA" {
type master;
file "db.0.168.192";
};

zone "0.0.127.IN-ADDR.ARPA" {
type master;
file "db.127.0.0";
};

----------------- /var/named/db.127.0.0
@ IN SOA computer-name.my-name.org. me.my-name.org. (
1;
10800;
3600;
604800;
86400 );

IN NS localhost.
1 IN PTR localhost.

---------------------------- /var/named/db.0.168.192
@ IN SOA computer-name.my-name.org. me.my-name.org. (
1;
10800;
3600;
604800;
86400 );

IN NS computer-name.my-name.org.
2 IN PTR computer-name.my-name.org.
2 IN PTR mail.my-name.org.
2 IN PTR www.my-name.org.
2 IN PTR news.my-name.org.

3 IN PTR pc.my-name.org.
10 IN PTR laptop.my-name.org.

---------------------/var/named/db.my-name
@ IN SOA computer-name.my-name.org. me.my-name.org. (
2;
10800;
3600;
604800;
86400 );

IN NS computer-name.my-name.org.
computer-name IN A 192.168.0.2

mail IN A 192.168.0.2
www IN A 192.168.0.2
news IN A 192.168.0.2

localhost IN A 127.0.0.1

pc IN A 192.168.0.3

laptop IN A 192.168.0.10
 
  


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
help needed to setup a DNS server can anyone say how to configure a DNS server subha Linux - Networking 4 04-27-2012 11:50 PM
Do I leave primary and seconday DNS blank for a DNS Server? imsam Linux - Networking 3 10-25-2004 01:48 PM
DNS server at home fbfd1338 Linux - Networking 6 10-07-2004 08:18 AM
need help to set up caching only dns server to with bogus DNS entries ullas Linux - Networking 1 10-28-2003 01:54 PM
DNS Server for home office with firewall rioguia Linux - Networking 3 12-29-2002 08:05 PM


All times are GMT -5. The time now is 07:15 PM.

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