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.
hi,
To configure DNS server in Linux normally we use BIND software. I am new in Linux and there are some few files which play role in configuring Linux DNS server.
1- /etc/hosts
2- /etc/resolv.conf
3- /etc/nsswitch.conf
4- /etc/named.conf
Please just in brif can you guide me about each file i.e when we should use /etc/hosts,resolve.conf ,nsswitch.cong ,and named.conf and what are there limitations?
hi,
To configure DNS server in Linux normally we use BIND software. I am new in Linux and there are some few files which play role in configuring Linux DNS server.
1- /etc/hosts
-------------------------------------
anything written inside this file will override the system query
as example see below
[noc@nc ~]$ ping ads.doubleclicks.net
PING ads.doubleclicks.net (127.0.0.1) 56(84) bytes of data.
64 bytes from nc (127.0.0.1): icmp_seq=1 ttl=64 time=0.070 ms
64 bytes from nc (127.0.0.1): icmp_seq=2 ttl=64 time=0.054 ms
this is because i added in this file as following
[noc@nc ~]$ cat /etc/hosts |grep ads
127.0.0.1 ads.doubleclicks.net
-----------------------------------
2- /etc/resolv.conf
------------------------------------
this file is the place you put to point your dns system query
to any named server
--------------------------------------
3- /etc/nsswitch.conf
----------------------------------
simple i dont know and never touch
------------------------------
4- /etc/named.conf
---------------------------------------
this file is for bind configuration to call zone file path
normaly this is symlink from /var/named/chroot/etc/named.conf
if your bind chrooted and if you want to see the file symlink or not
just use ls -l /etc/named.conf
-------------------------------------
Please just in brif can you guide me about each file i.e when we should use /etc/hosts,resolve.conf ,nsswitch.cong ,and named.conf and what are there limitations?
thanks in advance
mypass
I not sure about the limitation in which area
Last edited by routers; 07-06-2010 at 11:05 AM.
Reason: change moral issue :)
@Chris - Just to confirm, as it is a rhel site, the information is fairly universal?
Just curious as i will be looking at this shortly but will be using a do it yourself (LFS variant) version.
Maybe, the subject of this (samba and windows) doesn't sound promising, but the early coverage of how Unix name resolution works is good.
for something like Bind itself there are tutorials and books aplenty, but try Bind Bind
and the Ablitz/Liu book.
Quote:
To configure DNS server in Linux normally we use BIND software.
We?? Well, it probably should not be an option that we accept without thinking. For simpler cases, BIND unnecessarily complicates set-up, and its history hardly makes you feel that it is a 'set and forget' solution if you want security. There are certainly some cases where BIND is a valid option, but taking it as the default option which is always accepted is probably not the right thinking.
@grail: the fundamentals don't usually vary between distros. The above is a good start, but read that link of mine. The one that can vary is the location (but not the content) of the BIND files ie named.conf and associated files.
For security, RH and some others put it under a chrooted dir (see link for details: chap 16).
Quote:
If you have installed the bind-chroot package, the BIND service will run in the /var/named/chroot environment. All configuration files will be moved there. As such, named.conf will be located in /var/named/chroot/etc/named.conf, and so on.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.