LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 11-14-2018, 11:00 PM   #1
catiewong
Member
 
Registered: Aug 2018
Posts: 190

Rep: Reputation: Disabled
bind server setup ( named)


hen I would is to setup a DNS server , so that server in the network can use it to resolve hostname .
I just would like to setup bind server on my centos ( only have primary DNS server ) , I follow the step to setup it as below , but fail

I add the following lines in /etc/named.conf
#vi /etc/named.conf

Code:
zone "testserver" IN {
type master;
file "/etc/fwd.testserver.db";
allow-update { none; };
};

#vi /etc/fwd.testserver.db

Code:
$TTL 86400
@   IN  SOA     primary.myserver.com. root.myserver.com. (
2014112511  ;Serial
3600        ;Refresh
1800        ;Retry
604800      ;Expire
86400       ;Minimum TTL
)
;Name Server Information
@      IN  NS      primary.myserver.com.
;IP address of Name Server
primary IN  A       192.168.1.10
;A - Record HostName To Ip Address
www     IN  A       192.168.1.20
;CNAME record
where my DNS server is myserver.com (192.168.1.10 ) , the server I want to resolve is 192.168.1.20 ( hostname is testserver )

while I ping testserver , it is not work.

would advise what is wrong in my seting .
 
Old 11-15-2018, 12:10 AM   #2
scasey
LQ Veteran
 
Registered: Feb 2013
Location: Tucson, AZ, USA
Distribution: CentOS 7.9.2009
Posts: 5,727

Rep: Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211
You've not defined testserver as a hostname in your named.conf Naming the zone doesn't mean anything...you could have named it "zone1" (not that you should do that...the zone should be named for the server it defines)
There must be at least an A record for the host:
Code:
testserver     IN  A       192.168.1.20
As written, you should be able to resolve www, 'tho.
If you can't do that, then your DNS is not set up correctly.

Caveat: It's been awhile since I've hosted my own DNS. For pure resolution purposes, I've found it much simpler to just use my ISPs' DNS servers.
 
Old 11-15-2018, 12:32 AM   #3
catiewong
Member
 
Registered: Aug 2018
Posts: 190

Original Poster
Rep: Reputation: Disabled
Do I need to config /etc/resolv.conf
 
Old 11-15-2018, 12:43 AM   #4
scasey
LQ Veteran
 
Registered: Feb 2013
Location: Tucson, AZ, USA
Distribution: CentOS 7.9.2009
Posts: 5,727

Rep: Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211
Quote:
Originally Posted by catiewong View Post
Do I need to config /etc/resolv.conf
Probably. That's where you tell the server to do its domain name resolution with testserver
Mine on my desktop. The first two are Cox name servers, the third is Google's
Code:
# more /etc/resolv.conf 
nameserver 68.2.16.30
nameserver 68.6.16.30
nameserver 8.8.8.8
yours would need to have
Code:
nameserver 192.168.1.20
 
Old 11-15-2018, 01:55 AM   #5
berndbausch
LQ Addict
 
Registered: Nov 2013
Location: Tokyo
Distribution: Mostly Ubuntu and Centos
Posts: 6,316

Rep: Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002
You need to understand the fundamentals first. Go through a DNS tutorial or read a book about it. It's very mature technology, and the internet has a lot of information about it.

/etc/resolv.conf is needed on the DNS client. Since the DNS server is most probably also a client, yes you need it.

As scasey points out, the zone file needs to include the mapping from IP address to hostname, not unlike the /etc/hosts file. But there is much more than that to a zone file, and the DNS server is more than the zone file. If you don't understand the fundamentals, you will probably fail.
 
  


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
(bind) named: couldn't open pid file '/var/run/named/named.pid' - any help? samengr Linux - Server 6 04-01-2009 06:22 AM
file /var/lib/named/var/named/reverse/named.zero failed: file not found Toadman Linux - Software 15 03-18-2009 07:01 PM
BIND/named Startup Error - named.root:1: '}' expected near ';' acutchin Linux - Server 4 11-10-2008 09:43 AM
chown -R named:named /var/named crash the system? joangopan Fedora 2 09-09-2007 02:46 AM
named.conf and named.caching-server.conf ? Ronin_tekorei Linux - Server 4 05-03-2007 07:34 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 02:36 PM.

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