Linux - NewbieThis 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
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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/
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.