LinuxQuestions.org
Help answer threads with 0 replies.
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 05-25-2008, 04:14 PM   #1
lhnw08
LQ Newbie
 
Registered: May 2008
Posts: 10

Rep: Reputation: 0
How to setup Linux DNS server for a small office/home network?


Hi,there,

I have registered one domain name with one static IP address,now I am planning to use 3 PCs to form a network,one for webserver,one for email server,and one for name server.I am using DSL connection with a router.
my webserver and email server are working now.I am trying to configure DNS server.I am planning to use Bind9 to configure my DNS server.
I already adjusted my domain registration to set up ns.mysite.com,www.mysite.com,mail.mysite.com.My static IP is 56.88.253.48,
My private 3 Pcs IP are 192.168.1.26,192.168.1.27,192.168.1.28.I am a newbie to Linux,I read several articles on how to setup small office/home network DNS server.But I didn't make it work yet.
So is there any DNS server expert who could give me some hints(like how to set up internal and external views...) on how to set it up step by step to help me out?

Any good help would be highly appreciated!

Joe
 
Old 05-25-2008, 04:17 PM   #2
asymptote
Member
 
Registered: Mar 2008
Posts: 236

Rep: Reputation: 37
I can help you with setting up DNS. I set it up in both Ubuntu using the packaged called bind9, and I set it up in Fedora using named. Which distribution are you using?
 
Old 05-25-2008, 04:28 PM   #3
lhnw08
LQ Newbie
 
Registered: May 2008
Posts: 10

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by asymptote View Post
I can help you with setting up DNS. I set it up in both Ubuntu using the packaged called bind9, and I set it up in Fedora using named. Which distribution are you using?
asymptote,

Thanks for your response!
I am using Fedora Core 4,Bind9...

Joe
 
Old 05-25-2008, 04:45 PM   #4
asymptote
Member
 
Registered: Mar 2008
Posts: 236

Rep: Reputation: 37
I'm PM'ing my lab that covers DNS (Can we not attach files on this forum???). Looking back at it I see that it's not really done as well as it could be done, but if you've any experience with Linux I think you should be alright. The three files you need to be concerned with on the DNS server are the /etc/named.conf, /var/named/named.domain.com, and /var/named/named.168.204.136 files. The names of the last two files depend on what you set in named.conf - hopefully you'll see the correlation.

The file you should be concerned with on the clients is /etc/resolv.conf - just add the IP address of the DNS server (this is not in the lab).

Be advised that this is more for the inside network - the 192.168 addresses. I'm not sure how to configure DNS so that it forwards a copy of its records to the ISP DNS server so everyone else around the world can resolve your host names. Check out what I have and tell me if I need to clarify anything for you.
 
Old 05-25-2008, 05:32 PM   #5
lhnw08
LQ Newbie
 
Registered: May 2008
Posts: 10

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by asymptote View Post
I'm PM'ing my lab that covers DNS (Can we not attach files on this forum???). Looking back at it I see that it's not really done as well as it could be done, but if you've any experience with Linux I think you should be alright. The three files you need to be concerned with on the DNS server are the /etc/named.conf, /var/named/named.domain.com, and /var/named/named.168.204.136 files. The names of the last two files depend on what you set in named.conf - hopefully you'll see the correlation.

The file you should be concerned with on the clients is /etc/resolv.conf - just add the IP address of the DNS server (this is not in the lab).

Be advised that this is more for the inside network - the 192.168 addresses. I'm not sure how to configure DNS so that it forwards a copy of its records to the ISP DNS server so everyone else around the world can resolve your host names. Check out what I have and tell me if I need to clarify anything for you.
asymptote,

How can I check your lab?Is possible that you could copy and the following
files here:
/etc/resolv.conf,named.conf,named.domain.com,named.168.204.136.zone
I can experiment your contents on my system.then I can ask yousome questions.
Thanks!

Joe
 
Old 05-25-2008, 05:35 PM   #6
asymptote
Member
 
Registered: Mar 2008
Posts: 236

Rep: Reputation: 37
I sent you a PM with my email address. Please follow the instructions so I can send you my lab. The lab has graphics in it which is why I wanted to send you that instead of just showing you my configuration files.
 
Old 05-25-2008, 08:22 PM   #7
lhnw08
LQ Newbie
 
Registered: May 2008
Posts: 10

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by asymptote View Post
I sent you a PM with my email address. Please follow the instructions so I can send you my lab. The lab has graphics in it which is why I wanted to send you that instead of just showing you my configuration files.
Asymptote,
Thanks for your attachment!In my unstanding,in your DNS setup Lab,basically you put your weberver and name server to share one static IP address and further more I can feel you put your web server and name server in one PC,Am I correct?Now I have a question,in your following forward lookup zone configuration:

IN NS www
www IN A 136.204.168.93

Can I understand:
IN NS www ;Name server and web server share
;one physical server.
www IN A 136.204.168.93;web server address map to ip address
;136.204.168.93
Am I correct?

How do you understand
NS www
mysite.com. MX 10 mail ;????

Thanks again for your help!

Joe
 
Old 05-25-2008, 09:58 PM   #8
asymptote
Member
 
Registered: Mar 2008
Posts: 236

Rep: Reputation: 37
Yes, the web server and name server are on the same machine. Good analysis

I can explain the other lines - I'll have to type it to you directly from my book. I'll have it for you in an hour or so.
 
Old 05-26-2008, 07:19 AM   #9
eliufoo
Member
 
Registered: Oct 2007
Posts: 71

Rep: Reputation: 15
Hey,
I would suggest you go through the links below, they will give you a good insight for DNS configuration.

http://howtoforge.com/traditional_dns_howto

http://www.linuxhomenetworking.com/w...onfiguring_DNS
 
Old 05-26-2008, 11:35 AM   #10
lhnw08
LQ Newbie
 
Registered: May 2008
Posts: 10

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by eliufoo View Post
Hey,
I would suggest you go through the links below, they will give you a good insight for DNS configuration.

http://howtoforge.com/traditional_dns_howto

http://www.linuxhomenetworking.com/w...onfiguring_DNS
Thanks! I am going to read it carefully.but I find I am going to enter into
an endless loop...I have been spening 4 days on reading DNS articles on internet without doing anything else,some stuff is very abstract and very complicated.
So now for me the first and very important thing is to make my small office DNS server working.Otherwise I can not do any business...
So I am going to post my configuration files such as resolv.conf,named.conf,zone files on this forum.Hopefully I can get some concret hints from DNS server experts and guru...

Joe
 
Old 05-26-2008, 07:22 PM   #11
lhnw08
LQ Newbie
 
Registered: May 2008
Posts: 10

Original Poster
Rep: Reputation: 0
DNS experts,
Let's go.The following are my DNS sever Named configuration files.They are my understanding of my reading,I do not experiment them yet.Any cooments,good advice and corrections would be highly appreciated.Thanks!

///////////////////////////////////////////////
//named.conf

options {
directory "/var/named";

listen-on port 53 {127.0.0.1; 56.88.253.48; };

allow-query { localhost; };
allow-transfer { localhost; };
allow-recursion {localhost; };

};



//caching nameserver

controls {
inet 127.0.0.1 allow { localhost; } keys { rndckey; };
};

acl "trusted-subnet" { 192.168.1.0/24 };

view "internal" {
match-clients { localnets; localhost; "trusted-subnet"; };
match-destinations { localnets; localhost; "trusted-subnet"; };
recursion yes;


zone "." IN {
type hint;
file "named.ca";
};
zone "localhost" IN {
type master;
file "localhost.zone";
allow-update { none; };
};
zone "0.0.127.in-addr.arpa" IN {
type master;
file "named.local";
allow-update { none; };
};
zone "1.168.192.in-addr.arpa" IN {
type master;
file "192.168.1.zone";
allow-update { none; };
};
zone "mysite.com" IN {
type master;
notify no;
file "mysiteinternal.zone";
allow-query { any; };
};
};

view "external" {
match-clients { any; };
recursion no;

zone "253.88.56.in-addr.arpa" IN {
type master;
file "56.88.253.zone";
allow-update { none; };
};

zone "mysite.com" IN {
type master;
notify no;
file "mysiteexternal.zone";
allow-query { any; };
};
};



//Zone file
// mysiteexternal.zone

$TTL 1D
@ IN SOA ns1.mysite.com. admin.mysite.com. (
2008052503 ; serial#
30m ; refresh rate
15m ; retry interval
1w ; expire delay
1h ) ; negative cache ttl
;
NS ns1.mysite.com.
MX 10 mail.mysite.com.
localhost A 127.0.0.1
mysite A 56.88.253.48
mail CNAME mysite
ns1 CNAME mysite
www CNAME mysite
mysite.com. TXT "v=spf1 a mx ~all"
ns1.mysite.com. TXT "v=spf1 a -all"

//Zone File
//56.88.253.zone

@ IN SOA ns1.mysite.com. admin.mysite. (
2008052503 ; serial #
30m ; refresh rate
15m ; retry interval
1w ; expire delay
1h ) ; negative cache ttl
;
NS ns1.mysite.com.
48 PTR mysite.com.


//Zone file
//mysiteinternal.zone


$TTL 1D
@ IN SOA ns1.mysite.com. admin.mysite.com. (
2008052503 ; serial#
30m ; refresh rate
15m ; retry interval
1w ; expire delay
1h ) ; negative cache ttl

NS ns1.mysite.com
MX 10 mail.mysite.com

localhost A 127.0.0.1
router A 192.168.1.1
ns1 A 192.168.1.26
mail A 192.168.1.27
www A 192.168.1.28




//Internal Reverse Zone file
// 192.168.1.zone

$TTL 86400
localhost. IN SOA localhost. root.localhost. (
2008052503 ; serial
3H ; refresh
15M ; retry
1w ; expire
3h ; minimum
)
localhost. IN NS localhost. ;localhost is the name server
26 PTR ns1.mysite.com.
27 PTR www.mysite.com.
28 PTR mail.mysite.com.
1 PTR router.mysite.com
 
Old 05-27-2008, 03:49 AM   #12
asymptote
Member
 
Registered: Mar 2008
Posts: 236

Rep: Reputation: 37
Here's what I see so far:
[code]
allow-query { localhost; };
allow-transfer { localhost; };
allow-recursion {localhost; };
[code]
I suggest you comment out these lines. If you try connecting a machine to your network and telling it to use this DNS server to resolve names, it won't work. The reason why is because these three lines tell bind to only allow interaction from the same machine on which bind is running (the localhost). That means any machines that try and request information will be denied. Try using the configuration as is, using an external machine to resolve, and then commenting out these lines. You'll see what I mean.

The rest of it is going to take me some time dissect. As you can tell from the lab I emailed you, it's very simple compared to your configuration. We never even got an email server going.
 
Old 05-27-2008, 11:05 AM   #13
lhnw08
LQ Newbie
 
Registered: May 2008
Posts: 10

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by asymptote View Post
Here's what I see so far:
[code]
allow-query { localhost; };
allow-transfer { localhost; };
allow-recursion {localhost; };
[code]
I suggest you comment out these lines. If you try connecting a machine to your network and telling it to use this DNS server to resolve names, it won't work. The reason why is because these three lines tell bind to only allow interaction from the same machine on which bind is running (the localhost). That means any machines that try and request information will be denied. Try using the configuration as is, using an external machine to resolve, and then commenting out these lines. You'll see what I mean.

The rest of it is going to take me some time dissect. As you can tell from the lab I emailed you, it's very simple compared to your configuration. We never even got an email server going.
Alan,
Thanks for your comments!
I don't experiement it yet...
But last night I tried your lab,it works,but I made some changfes and have some questions.
1>I don't know what connection you used?I use DSL modem with a router.So my DNS IP setup,and static IP setup are controlled by my routerand, at the same time my DSL service provider gave me Primary and second DNS IP to me too. I can't follow your example and put static IP and DNS IP directly into one of my machines.If I do so,I can't even go to internet.
2>After I followed your example,The emails I sent from my web server using PHPMailer can't go to my email server directly,it goes to webserver mail directly /var/spool/mail, the system automatically set a file for me joe.txt,and I opened it and found all the emails I sent are here,and the system changed my email account from joe@mysite.com to dameon@mysite.com.So I think in the DNS server setup,I have to put my email server into it,then I will see...

Thanks and have a nice day!

Joe
 
Old 05-27-2008, 12:48 PM   #14
asymptote
Member
 
Registered: Mar 2008
Posts: 236

Rep: Reputation: 37
We didn't use domain names that were registered (asymptote9x.com) so we didn't allow for your DNS servers to be updated with an ISP. The only way people would find our domain is if they set their network settings to use our DNS server. I'm also not too sure about setting up email - I'm sure it's really easy but I never read the documentation (or all those tutorials). It's one of my long-term goals.

At this point I advise you seek help from someone more experienced than me Sorry!
 
Old 05-28-2008, 11:11 AM   #15
lhnw08
LQ Newbie
 
Registered: May 2008
Posts: 10

Original Poster
Rep: Reputation: 0
Talking

Linuxquestions.org is really good organization...really good...collect a lot of questions everyday...but...it is really like question in and question out...
 
  


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
Small home server setup question mfilippa Debian 5 04-15-2006 09:11 PM
Home Network Setup Help Linux Server running Windoze XP clients + ADSL router BeaverusIV Linux - Networking 10 04-22-2005 04:07 PM
Is Linux right for small office network? glenn69 Linux - Networking 1 07-29-2004 11:59 PM
DNS Server for home office with firewall rioguia Linux - Networking 3 12-29-2002 08:05 PM
Small Network -- Linux Web, DNS, SAMBA server -- Help/suggestions please! Bungo2000 Linux - Networking 2 03-30-2002 09:55 AM

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

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