How to setup Linux DNS server for a small office/home network?
Linux - ServerThis forum is for the discussion of Linux Software used in a server related context.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
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?
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?
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...
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.
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!
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.
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! 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...
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!
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; };
};
};
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.
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...
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!
Linuxquestions.org is really good organization...really good...collect a lot of questions everyday...but...it is really like question in and question out...
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.