LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
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 07-05-2010, 12:22 AM   #1
gardenair
Member
 
Registered: Oct 2004
Location: LH
Posts: 648

Rep: Reputation: 45
DNS files .


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?

thanks in advance
mypass

Last edited by gardenair; 07-05-2010 at 01:52 AM.
 
Old 07-05-2010, 04:49 AM   #2
subho.d
Member
 
Registered: Jun 2010
Location: INDIA
Distribution: All Linux & Unix
Posts: 86

Rep: Reputation: 19
hi ;
for server u need fwd zone file & bak zone file ...
 
Old 07-06-2010, 10:58 AM   #3
routers
Member
 
Registered: Aug 2005
Location: Malaysia - KULMY / CNXTH
Distribution: Slackware, Fedora, FreeBSD, Sun O/S 5.10, CentOS
Posts: 787
Blog Entries: 6

Rep: Reputation: 75
Quote:
Originally Posted by gardenair View Post
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 :)
 
Old 07-06-2010, 07:49 PM   #4
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Rocky 9.2
Posts: 18,359

Rep: Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751
1. /etc/hosts
usually just the loopback address(es) ie

127.0.0.1 localhost.localdomain localhost

and sometimes ip/name of the system if static eg

192.168.0.1 mysystem.mydomain mysystem

2. /etc/resolv.conf
when your system needs to find another machine, look in here for the DNS servers to ask (usually those of your ISP).

2. /etc/nsswitch.conf

various stuff; basically specifies eg

networks: files dns

means when looking for another system, check local files first ie /etc/hosts. If not found, ask DNS ie resolv.conf

4. named.conf

config file for a DNS (aka BIND) server

See http://www.linuxtopia.org/online_boo...ion/index.html for some good explanations/howto
 
Old 07-06-2010, 08:44 PM   #5
grail
LQ Guru
 
Registered: Sep 2009
Location: Perth
Distribution: Manjaro
Posts: 10,007

Rep: Reputation: 3191Reputation: 3191Reputation: 3191Reputation: 3191Reputation: 3191Reputation: 3191Reputation: 3191Reputation: 3191Reputation: 3191Reputation: 3191Reputation: 3191
@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.
 
Old 07-07-2010, 03:46 AM   #6
salasi
Senior Member
 
Registered: Jul 2007
Location: Directly above centre of the earth, UK
Distribution: SuSE, plus some hopping
Posts: 4,070

Rep: Reputation: 897Reputation: 897Reputation: 897Reputation: 897Reputation: 897Reputation: 897Reputation: 897
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.
 
Old 07-07-2010, 11:17 PM   #7
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Rocky 9.2
Posts: 18,359

Rep: Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751
@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.
 
  


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
DNS zone files grob115 Linux - Server 6 06-30-2010 10:34 AM
DNs log files sachin1361 Linux - Enterprise 10 09-18-2007 01:56 AM
DNS Zone Files Swakoo Linux - Newbie 3 06-22-2005 04:54 AM
Bind and DNS information conf files and zone files aaronluke Linux - General 1 10-13-2002 09:41 AM
Get Zone files from DNS? mig Linux - General 0 02-28-2002 03:03 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 04:07 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
Open Source Consulting | Domain Registration