LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 03-11-2008, 08:23 AM   #1
tsaravan
Member
 
Registered: Jun 2005
Location: India
Posts: 101

Rep: Reputation: 15
DNS setup help


Hi,

I want to setup DNS for resolving IPs of Intranet services provided by our head office for example they provide us kmm.teri.res.in and 'teri.res.in' is their domain. I do not want to configure all our workstations DNS of our head office Name Server IP as many times it fails to connect. Hence i want to maintain our own DNS. In this regard, an example would be highly helpfull.

regards,

T. Saravana
 
Old 03-12-2008, 12:45 AM   #2
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Centos 6.8, Centos 5.10
Posts: 17,294

Rep: Reputation: 2358Reputation: 2358Reputation: 2358Reputation: 2358Reputation: 2358Reputation: 2358Reputation: 2358Reputation: 2358Reputation: 2358Reputation: 2358Reputation: 2358
Try googling 'DNS slave'
 
Old 03-12-2008, 12:59 AM   #3
tsaravan
Member
 
Registered: Jun 2005
Location: India
Posts: 101

Original Poster
Rep: Reputation: 15
Quote:
Originally Posted by chrism01 View Post
Try googling 'DNS slave'
Thank for your reply.

I do not want to have DNS slave as i informed that many times connection fails at head office's DNS server and never gets updated during that time. Hence, we will be in trouble accessing certain services when the IP has been changed during the connection failure. I can always get the changed IPs through email which i will update it here which is manageable.

So, if i get a clue to setup a independent DNS server having the scenario mention earlier.

regards,

T. Saravana.
 
Old 03-12-2008, 01:45 AM   #4
konsolebox
Senior Member
 
Registered: Oct 2005
Distribution: Gentoo, Slackware, LFS
Posts: 2,248
Blog Entries: 8

Rep: Reputation: 235Reputation: 235Reputation: 235
Hello. Does that mean you'll have 2 dns servers.. 1 in your head office and 1 in your local office that both needs the same dns configuration to your workstations and 1 is updated only manually? Why not setup a slave since a slave needs to connect only once? If there is an update problem in the connection, perhaps it is then that you'll be updating your slave manualy.

Btw maybe you only mean that your local office will be the one to provide the primary dns instead, no?

Also checkout pdnsd.. maybe it's the one you need.
 
Old 03-12-2008, 04:35 AM   #5
tsaravan
Member
 
Registered: Jun 2005
Location: India
Posts: 101

Original Poster
Rep: Reputation: 15
Quote:
Originally Posted by konsolebox View Post
Hello. Does that mean you'll have 2 dns servers.. 1 in your head office and 1 in your local office that both needs the same dns configuration to your workstations and 1 is updated only manually? Why not setup a slave since a slave needs to connect only once? If there is an update problem in the connection, perhaps it is then that you'll be updating your slave manualy.

Btw maybe you only mean that your local office will be the one to provide the primary dns instead, no?

Also checkout pdnsd.. maybe it's the one you need.
Hi,

Thank you for your reply.

Actually i am looking for name resolution for private IP and for Internet let it go through DNS ip provided by ISP. In this regard, i have broadband connection which is configured on Linux Server and provided access to the users through squid proxy. On this Server i want to setup DNS for name resolution for private IPs. These private IPs are Intranet services being provided by our head office. Hence, i thought of having independent DNS Server to resolve name resolution for private IPs. The one you have said pdnsd is not sure about helpfulness in the said scenario. However, let me think of the salve, but would like know if there is an option to have one DNS server here itself for name resolution of private IPs.

regards,

T. Saravana
 
Old 03-12-2008, 05:52 AM   #6
niceguy_81333
Member
 
Registered: Mar 2008
Location: India
Distribution: RHEL5
Posts: 34

Rep: Reputation: 15
Mr Savarana
you haven't mentioned the distro u r using. Well i am explaining the following procedure to configre DNS in RHEL5.
1. Install bind packages and caching packages.
#rpm -ivh bind*
#rpm -ivh caching*
2. open /etc directory.you will find two files: named.caching-nameserver.conf, named.rfc1912.zone
#cd /etc
# ls -l named.*
3. open the first file in VI editor
# vi named.caching-nameserver.conf
at line 15 add the IP addres of your DNS server
at line 23 allow-query {local host; 192.168.0.0/24;}
at line 32 match-client {local host;192.168.0.0/24;}
Note : i am using 192.168.0.0 as an example network.
save the file
4. open the second file in VI editor
# vi named.rfc1912.zone
copy the lines from line 21 to line 25 and paste at the end. Edit the lines as follows :
zone "kmm.teri.resi.in" {
type master;
file "kmm.for";
allow-update {none};
}
save the file
5. Now go to /var/named/chroot/var/named
6. copy the file localhost.zone and name it as kmm.for
# cp localhost.zone kmm.for
7. Open the file kmm.for
and add following lines in the end.
sys1 IN A 192.168.0.1
sys2 IN A 192.168.0.2
save the file
8. #vi /etc/resolv.conf
nameserver 192.168.0.3
Note : ip address of the machine you are configuring as DNS server.

9. now start the service
#service named restart
#nslookup
enter the name and u should get the ip address as reply if everything works well.

I wish you bestluck. Any questions are welcome.
Rgds
Bil

Last edited by niceguy_81333; 03-12-2008 at 06:09 AM.
 
Old 03-12-2008, 06:56 AM   #7
konsolebox
Senior Member
 
Registered: Oct 2005
Distribution: Gentoo, Slackware, LFS
Posts: 2,248
Blog Entries: 8

Rep: Reputation: 235Reputation: 235Reputation: 235
Quote:
Originally Posted by tsaravan View Post
Actually i am looking for name resolution for private IP and for Internet let it go through DNS ip provided by ISP.
you can do both using a single dns server using bind.. for your private IPs you can add a zone file and for the internet you can have it independent (just as a common resolver) or you can have it forward requests to your ISP dns by using the forward option in the options block of named.conf.
Quote:
The one you have said pdnsd is not sure about helpfulness in the said scenario.
Don't worry pdnsd is just an alternative.. it's really meant for caching and not as a stand-alone dns program.
Quote:
On this Server i want to setup DNS for name resolution for private IPs. These private IPs are Intranet services being provided by our head office. Hence, i thought of having independent DNS Server to resolve name resolution for private IPs... However, let me think of the salve, but would like know if there is an option to have one DNS server here itself for name resolution of private IPs.
Actually i thought the names was also provided by the head office.. so it's just the intranet IPs right? If you're the one going to config the names, i mean names.domain, you can do all these things in a single DNS server.. actually a single bind..

By summary here are my points:
(a) You can build your own DNS server as a stand-alone resolver for internet (outside) names independent of your ISP DNS.
(b) You can configure your DNS server to forward requests to your IP DNS perhaps to minimize server load or to resolve names that the server is not able to resolve.
(c) You can configure your DNS server to have private zone info (by adding zone files) to resolve your private IP addresses.

Please read the DNS HOWTO if you need more info.. it's a little old but it's a complete guide believe me.

niceguy_81333 might also be able to do some help

i'll be back tomorrow

regards

Last edited by konsolebox; 03-12-2008 at 06:58 AM.
 
Old 03-18-2008, 07:46 AM   #8
tsaravan
Member
 
Registered: Jun 2005
Location: India
Posts: 101

Original Poster
Rep: Reputation: 15
Quote:
Originally Posted by niceguy_81333 View Post
Mr Savarana
you haven't mentioned the distro u r using. Well i am explaining the following procedure to configre DNS in RHEL5.
1. Install bind packages and caching packages.
#rpm -ivh bind*
#rpm -ivh caching*
2. open /etc directory.you will find two files: named.caching-nameserver.conf, named.rfc1912.zone
#cd /etc
# ls -l named.*
3. open the first file in VI editor
# vi named.caching-nameserver.conf
at line 15 add the IP addres of your DNS server
at line 23 allow-query {local host; 192.168.0.0/24;}
at line 32 match-client {local host;192.168.0.0/24;}
Note : i am using 192.168.0.0 as an example network.
save the file
4. open the second file in VI editor
# vi named.rfc1912.zone
copy the lines from line 21 to line 25 and paste at the end. Edit the lines as follows :
zone "kmm.teri.resi.in" {
type master;
file "kmm.for";
allow-update {none};
}
save the file
5. Now go to /var/named/chroot/var/named
6. copy the file localhost.zone and name it as kmm.for
# cp localhost.zone kmm.for
7. Open the file kmm.for
and add following lines in the end.
sys1 IN A 192.168.0.1
sys2 IN A 192.168.0.2
save the file
8. #vi /etc/resolv.conf
nameserver 192.168.0.3
Note : ip address of the machine you are configuring as DNS server.

9. now start the service
#service named restart
#nslookup
enter the name and u should get the ip address as reply if everything works well.

I wish you bestluck. Any questions are welcome.
Rgds
Bil

Thank you very much for your reply.

Somehow i am not able to succeed in setting up DNS. Following the scenario, could be please send the solution.

1) I have two broadband connections. One is configured for VPN connectivity using Netgear between our head office and local office for Intranet purpose. This VPN box ip is the gateway for all our users' workstations ie., 192.168.0.3

2) The another broadband connections is used for Internet which has been setup using pppoe-setup. This is being provide to the users through squid proxy server. This server has two NICs, one is connected to our network (ip 192.168.0.12) and another one is connected to adsl modem which has assigned static public ip upon connection with authentication. In this Server i want to configure DNS.

3) The addresses of the services being provided by our head office are xxx.teri.res.in. In this regard, the head office has been created with zone name as 'teri.res.in'. This is for only information and i do not want to configure as slave as informed earlier. In this regard, i want to know one basic question whether the same zone name can be created, if not, why?.

4) They have email server also and the address is venus.teri.res.in which needs to be in the DNS configuration.

In the above scenario, please give me the step by step solution. And also the a clarification as per the SL.No.3 mentioned above.

regards,

T. Saravana.
 
Old 03-18-2008, 07:49 AM   #9
tsaravan
Member
 
Registered: Jun 2005
Location: India
Posts: 101

Original Poster
Rep: Reputation: 15
Quote:
Originally Posted by konsolebox View Post
you can do both using a single dns server using bind.. for your private IPs you can add a zone file and for the internet you can have it independent (just as a common resolver) or you can have it forward requests to your ISP dns by using the forward option in the options block of named.conf.Don't worry pdnsd is just an alternative.. it's really meant for caching and not as a stand-alone dns program.Actually i thought the names was also provided by the head office.. so it's just the intranet IPs right? If you're the one going to config the names, i mean names.domain, you can do all these things in a single DNS server.. actually a single bind..

By summary here are my points:
(a) You can build your own DNS server as a stand-alone resolver for internet (outside) names independent of your ISP DNS.
(b) You can configure your DNS server to forward requests to your IP DNS perhaps to minimize server load or to resolve names that the server is not able to resolve.
(c) You can configure your DNS server to have private zone info (by adding zone files) to resolve your private IP addresses.

Please read the DNS HOWTO if you need more info.. it's a little old but it's a complete guide believe me.

niceguy_81333 might also be able to do some help

i'll be back tomorrow

regards
Thank you very much for your reply.


I have requested a salution from the niceguy_81333.
 
Old 03-26-2008, 11:39 PM   #10
konsolebox
Senior Member
 
Registered: Oct 2005
Distribution: Gentoo, Slackware, LFS
Posts: 2,248
Blog Entries: 8

Rep: Reputation: 235Reputation: 235Reputation: 235
things should be easier if you have your names as 'xxx.lo.teri.res.in' and have your server as the authorized dns for the zone lo.teri.res.in.

but perhaps you can do

head office dns
Code:
@	IN SOA	ns1.teri.res.in. emailaddr.teri.res.in. (
	########## ; Serial
	####       ; Refresh
	####       ; Retry
	#######    ; Expire
	##### )    ; Minimum

		NS	ns1
		NS	ns2

		A	xxx.xxx.xxx.xxx

		MX	0	venus

ns1	IN	A	'head.office.dns.ip'
ns2	IN	A	'local.office.dns.ip'

venus	IN	A	'XXX.XXX.XXX.XXX'
local office dns
Code:
@	IN SOA	ns2.teri.res.in. emailaddr.teri.res.in. (
	########## ; Serial
	####       ; Refresh
	####       ; Retry
	#######    ; Expire
	##### )    ; Minimum

		NS	ns1.teri.res.in.
		NS	ns2.teri.res.in.

		A	xxx.xxx.xxx.xxx

		MX	0	venus

ns1	IN	A	'head.office.dns.ip'
ns2	IN	A	'local.office.dns.ip'

venus	IN	A	'XXX.XXX.XXX.XXX'

xxx	IN	A	'XXX.XXX.XXX.XXX'
yyy	IN	A	'XXX.XXX.XXX.XXX'
i haven't tried this yet though.

perhaps you can have 2 mx servers but you must configure each server to forward mails with unregistered destinations to the alternate mail server and reject mails with unregistered destinations that already came from the first mail server. there are also other ways to do this.

again having your own zone like lo.teri.res.in. should make things a lot easier.

edit: this might not even work at all since the soa is already set for the head office's dns and might not forward request to ns2

Last edited by konsolebox; 03-26-2008 at 11:42 PM.
 
Old 03-28-2008, 03:47 AM   #11
tsaravan
Member
 
Registered: Jun 2005
Location: India
Posts: 101

Original Poster
Rep: Reputation: 15
Quote:
Originally Posted by konsolebox View Post
things should be easier if you have your names as 'xxx.lo.teri.res.in' and have your server as the authorized dns for the zone lo.teri.res.in.

but perhaps you can do

head office dns
Code:
@	IN SOA	ns1.teri.res.in. emailaddr.teri.res.in. (
	########## ; Serial
	####       ; Refresh
	####       ; Retry
	#######    ; Expire
	##### )    ; Minimum

		NS	ns1
		NS	ns2

		A	xxx.xxx.xxx.xxx

		MX	0	venus

ns1	IN	A	'head.office.dns.ip'
ns2	IN	A	'local.office.dns.ip'

venus	IN	A	'XXX.XXX.XXX.XXX'
local office dns
Code:
@	IN SOA	ns2.teri.res.in. emailaddr.teri.res.in. (
	########## ; Serial
	####       ; Refresh
	####       ; Retry
	#######    ; Expire
	##### )    ; Minimum

		NS	ns1.teri.res.in.
		NS	ns2.teri.res.in.

		A	xxx.xxx.xxx.xxx

		MX	0	venus

ns1	IN	A	'head.office.dns.ip'
ns2	IN	A	'local.office.dns.ip'

venus	IN	A	'XXX.XXX.XXX.XXX'

xxx	IN	A	'XXX.XXX.XXX.XXX'
yyy	IN	A	'XXX.XXX.XXX.XXX'
i haven't tried this yet though.

perhaps you can have 2 mx servers but you must configure each server to forward mails with unregistered destinations to the alternate mail server and reject mails with unregistered destinations that already came from the first mail server. there are also other ways to do this.

again having your own zone like lo.teri.res.in. should make things a lot easier.

edit: this might not even work at all since the soa is already set for the head office's dns and might not forward request to ns2

Thank you for your reply.

I dont want to worry about the Head office dns and also their dns forward request. I want dns setup independently with same domain name of head office. In this regard, i want to know that the Mail Server is in our head office and i have some programme to send email for which if i put entry of that mail server address in our zone, will it work.

Sorry, i query may be very basic as i am new to this.

regards,

T.Saravana
 
Old 03-28-2008, 05:58 AM   #12
mahmoud
Member
 
Registered: Apr 2006
Location: UK
Distribution: Mandriva, Debain, Redhat, Fedora, Ubuntu, FreeBSD
Posts: 269

Rep: Reputation: 30
if you just want to point to your intranet and you have a gateway or proxy i will advice to edit the host file
and put the intranet site in there.
much easier but if you insist on building your own dns server it has to b caching and forwarding
which aint very easy
http://www.linux-sxs.org/internet_serving/dns.html
try DJBDNS seems more secure the BIND and they have some ok docs -> http://tinydns.org/
 
  


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
DNS Setup Yomaoni Linux - General 7 03-18-2008 12:54 PM
DNS setup rarbis Linux - Server 5 03-18-2008 11:07 AM
How do I Setup DNS bsurfin Linux - Newbie 3 05-21-2004 09:05 PM
DNS how to setup? wilcoNL Linux - Newbie 2 03-28-2004 06:25 AM


All times are GMT -5. The time now is 02:10 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration