LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 01-01-2012, 07:03 AM   #1
Asila
LQ Newbie
 
Registered: Dec 2011
Posts: 23

Rep: Reputation: Disabled
Unhappy problom with Configure DNS server in centos 6


hii eveybody
i need to configure DNS ,it should be configured to use 192.168.0.0/24 and not the localhost (127.0.0.1)..
I have
1.Install BIND
2.Configure BIND
Quote:
[root@localhost ~]# vi /etc/named.conf
//
// named.conf
//
// Provided by Red Hat bind package to configure the ISC BIND named(8) DNS
// server as a caching only nameserver (as a localhost DNS resolver only).
//
// See /usr/share/doc/bind*/sample/ for example named configuration files.
//

options {

#listen-on port 53 { 127.0.0.1; };

listen-on-v6 { none; };
directory"/var/named";
dump-file"/var/named/data/cache_dump.db";
statistics-file"/var/named/data/named_stats.txt";
memstatistics-file"/var/named/data/named_mem_stats.txt";

allow-query{ localhost; 192.168.0.0/24;};
allow-transfer { localhost; 192.168.0.0/24; };

recursion yes;
dnssec-enable yes;
dnssec-validation yes;
dnssec-lookaside auto;
/* Path to ISC DLV key */
bindkeys-file "/etc/named.iscdlv.key";
};
logging {
channel default_debug {
file "data/named.run";
severity dynamic;
};
};


view "internal" {
match-clients {
localhost;
192.168.0.0/24;
};
zone "." IN {
type hint;
file "named.ca";
};
zone "pure.world" IN {
type master;
file "pure.world.lan";
allow-update { none; };
};
zone "0.168.192.in-addr.arpa" IN {
type master;
file "0.168.192.db";
allow-update { none; };
};
include "/etc/named.rfc1912.zones";
};
view "external" {
match-clients { any; };
allow-query { any; };
recursion no;
zone "pure.world" IN {
type master;
file "pure.world.wan";
allow-update { none; };
};
zone "80.0.168.192.in-addr.arpa" IN {
type master;
file "80.0.168.192.db";
allow-update { none; };
};
};
3.Create zone files that servers resolve IP address from domain name
4.Start BIND
Quote:
[root@localhost ~]# /etc/rc.d/init.d/named start
Starting named:[ OK ]
[root@dlp ~]# chkconfig named on
5.
Quote:
[root@loctalhos ~]# vi /etc/resolv.conf
I get this message!!
Quote:
# Generated by NetworkManager


# No nameservers found; try putting DNS servers into your
# ifcfg files in /etc/sysconfig/network-scripts like so:
#
# DNS1=xxx.xxx.xxx.xxx
# DNS2=xxx.xxx.xxx.xxx
# DOMAIN=lab.foo.com bar.foo.com
 
Old 01-01-2012, 07:07 AM   #2
Asila
LQ Newbie
 
Registered: Dec 2011
Posts: 23

Original Poster
Rep: Reputation: Disabled
how can I fix it..PLZ
 
Old 01-01-2012, 07:15 AM   #3
blue_print
Member
 
Registered: May 2010
Location: In world
Distribution: RHEL, CentOS, Ubuntu
Posts: 275
Blog Entries: 3

Rep: Reputation: 50
Can you give more description about this issue?

From your details, I understood that your client systems not showing DNS servers IP in /etc/resolv.conf. Am I right?

If so, Is your clients systems using DHCP IP address or Static IP address?
 
Old 01-02-2012, 12:04 AM   #4
Asila
LQ Newbie
 
Registered: Dec 2011
Posts: 23

Original Poster
Rep: Reputation: Disabled
hi sir
yes sir u are right!

actually I'm new in using Linux

I have Linux as server & Win XP as client
And the client gets its IP from DHCP server
 
Old 01-02-2012, 01:01 AM   #5
blue_print
Member
 
Registered: May 2010
Location: In world
Distribution: RHEL, CentOS, Ubuntu
Posts: 275
Blog Entries: 3

Rep: Reputation: 50
1. You must configure DHCP to set the DNS servers as your Linux Server IP
2. You can Linux Server IP (DNS server IP) in Network configuration of Windows and test the DNS
 
Old 01-02-2012, 01:18 AM   #6
Asila
LQ Newbie
 
Registered: Dec 2011
Posts: 23

Original Poster
Rep: Reputation: Disabled
yes sir , but how can i do that
when i do the dig comment its reply
Quote:
No nameserver found; try putting DNS server into your ifcfg files in /etc/sysconfig
 
Old 01-02-2012, 04:58 AM   #7
deep27ak
Senior Member
 
Registered: Aug 2011
Location: Bangalore, India
Distribution: RHEL 7.x, SLES 11 SP2/3/4
Posts: 1,195
Blog Entries: 4

Rep: Reputation: 221Reputation: 221Reputation: 221
post the output of these commands
Code:
#cat /etc/resolv.conf
#nslookup (your hostname)
#cat pure.world.lan
#cat /var/log/messages
 
Old 01-02-2012, 05:27 AM   #8
Asila
LQ Newbie
 
Registered: Dec 2011
Posts: 23

Original Poster
Rep: Reputation: Disabled
hii

Quote:
[root@localhost ~]# cat /etc/resolv.conf
# Generated by NetworkManager
domain localdomain
search localdomain
nameserver 192.168.13.2
[root@localhost ~]# nslookup pure.world
Server: 192.168.13.2
Address: 192.168.13.2#53

** server can't find pure.world: NXDOMAIN

[root@localhost ~]# cat pure.world.lan
cat: pure.world.lan: No such file or directory
[root@localhost ~]# #cat /var/log/messages
[root@localhost ~]#
I notes the mistack
how can I solve them
 
Old 01-02-2012, 05:32 AM   #9
Asila
LQ Newbie
 
Registered: Dec 2011
Posts: 23

Original Poster
Rep: Reputation: Disabled
how can I Edit this
 
Old 01-02-2012, 06:02 AM   #10
deep27ak
Senior Member
 
Registered: Aug 2011
Location: Bangalore, India
Distribution: RHEL 7.x, SLES 11 SP2/3/4
Posts: 1,195
Blog Entries: 4

Rep: Reputation: 221Reputation: 221Reputation: 221
try this

Code:
#vi /etc/resolv.conf
(comment these lines)
# Generated by NetworkManager
#domain localdomain
#search localdomain
nameserver 192.168.13.2
I asked you to post your zone file
Code:
[root@localhost ~]# cat pure.world.lan
cat: pure.world.lan: No such file or directory
(go to the location where you have saved your zone file)
Code:
like may be in /var/named/
or
/var/named/chroot/var/named
check the command which you have given?
Code:
[root@localhost ~]# #cat /var/log/messages
[root@localhost ~]# cat /var/log/messages                          <-------notice the change in both lines
 
Old 01-02-2012, 06:05 AM   #11
deep27ak
Senior Member
 
Registered: Aug 2011
Location: Bangalore, India
Distribution: RHEL 7.x, SLES 11 SP2/3/4
Posts: 1,195
Blog Entries: 4

Rep: Reputation: 221Reputation: 221Reputation: 221
Follow this link. It might be helpful for you

dns-configuration-in-rhel-forward-and-reverse-zone
 
Old 01-02-2012, 07:05 AM   #12
Asila
LQ Newbie
 
Registered: Dec 2011
Posts: 23

Original Poster
Rep: Reputation: Disabled
Question

my zone file
Quote:
$TTL 86400
@ IN SOA asd.pure.world. root.pure.world.(
2011071002 ;Serial
3600 ;Refresh
1800 ;Retry
604800 ;Expire
86400 ;Minimum TTL

)

IN NS asd.pure.world.
IN A 192.168.0.30
IN MX 10 asd.pure.world.
asd IN A 192.168.0.30
ftp IN CNAME ftp.pure.world
~
~
~
~
~
~
~
"/var/named/pure.world.lan" 16L, 503C
and the cat /etc/resolv.conf
Quote:
[root@localhost ~]# cat /etc/resolv.conf
# Generated by NetworkManager


# No nameservers found; try putting DNS servers into your
# ifcfg files in /etc/sysconfig/network-scripts like so:
#
# DNS1=xxx.xxx.xxx.xxx
# DNS2=xxx.xxx.xxx.xxx
# DOMAIN=lab.foo.com bar.foo.com
[root@localhost ~]#
I'm new in using Linux
 
Old 01-02-2012, 07:35 AM   #13
deep27ak
Senior Member
 
Registered: Aug 2011
Location: Bangalore, India
Distribution: RHEL 7.x, SLES 11 SP2/3/4
Posts: 1,195
Blog Entries: 4

Rep: Reputation: 221Reputation: 221Reputation: 221
Code:
#vi named.conf
#listen-on port 53 { 127.0.0.1; 192.168.13.0/24};

listen-on-v6 { none; };
directory"/var/named";
dump-file"/var/named/data/cache_dump.db";
statistics-file"/var/named/data/named_stats.txt";
memstatistics-file"/var/named/data/named_mem_stats.txt";

allow-query{ localhost; 192.168.13.0/24;};
allow-transfer { localhost; 192.168.13.0/24; };
in your zone file
Code:
$TTL 86400
@ IN SOA asd.pure.world. root.pure.world.(
2011071002 ;Serial
3600 ;Refresh
1800 ;Retry
604800 ;Expire
86400 ;Minimum TTL

)

IN NS asd.pure.world.
IN A 192.168.13.2
IN MX 10 asd.pure.world.
asd IN A 192.168.13.2
ftp IN CNAME ftp.pure.world
check your resolv.conf

take a backup of current resolv.conf

Code:
#cp /etc/resolv.conf  /resolv.conf.orig
Code:
#vi /etc/resolv.conf
(remove everyline and add this)
nameserver 192.168.13.2
then restart the service
Code:
#service named restart
try this command and show me the output
Code:
#nslookup asd.pure.world.
 
Old 01-02-2012, 08:40 AM   #14
Asila
LQ Newbie
 
Registered: Dec 2011
Posts: 23

Original Poster
Rep: Reputation: Disabled
thank u
But my IP is 192.168.0.0/24
even I Make the change its still give me the same message
No server could be reached
 
Old 01-02-2012, 10:25 AM   #15
Asila
LQ Newbie
 
Registered: Dec 2011
Posts: 23

Original Poster
Rep: Reputation: Disabled
vi /etc/named.conf
Quote:
//
// named.conf
//
// Provided by Red Hat bind package to configure the ISC BIND named(8) DNS
// server as a caching only nameserver (as a localhost DNS resolver only).
//
// See /usr/share/doc/bind*/sample/ for example named configuration files.
//


options {
listen-on port 53 {127.0.0.1; 192.168.0.0/24; };
listen-on-v6 port 53 { none; };
directory "/var/named";
dump-file "/var/named/data/cache_dump.db";
statistics-file "/var/named/data/named_stats.txt";
memstatistics-file "/var/named/data/named_mem_stats.txt";
query-source port 53
allow-query { localhost; 192.168.0.0/24;};

allw-transfer {localhost; 192.168.0.0/24;};

recursion yes;
vi /etc/named/pure.world.lan
Quote:
$TTL 86400
@ IN SOA asd.pure.world. root.pure.world.(
2011071002 ;Serial
3600 ;Refresh
1800 ;Retry
604800 ;Expire
86400 ;Minimum TTL

)

IN NS asd.pure.world.
IN A 192.168.0.30
IN MX 10 asd.pure.world.
asd IN A 192.168.0.30
ftp IN CNAME ftp.pure.world
~
~
~
~
~
~
~
"/var/named/pure.world.lan" 16L, 503C
vi /etc/named/pure.world.wan
Quote:
$TTL 86400
@ IN SOA asd.pure.world. root.pure.world.(
2011071001 ;Serial
3600 ;Refresh
1800 ;Retry
604800 ;Expire
86400 ;Minimum TTL

)

IN NS asd.pure.world.
IN A 172.16.0.82
IN MX 10 asd.pure.world.
asd IN A 172.16.0.82
~
~
~
~
~
~
~
~
"/var/named/pure.world.wan" 16L, 506C
vi /etc/named/0.168.192.db
Quote:


$TTL 86400
@ IN SOA asd.pure.world. root.pure.world. (
2011071001 ;Serial
3600 ;Refresh
1800 ;Retry
604800 ;Expire
86400 ;Minimum TTL

)


IN NS asd.pure.world.
IN PTR pure.world.
IN A 255.255.255.0
30 IN PTR asd.pure.world.
~

~
~
~
"/var/named/0.168.192.db" 20L, 410C
vi /etc/named/80.0.168.192.db
Quote:
$TTL 86400
@ IN SOA asd.pure.world. root.pure.world. (
2011071001 ;Serial
3600 ;Refresh
1800 ;Retry
604800 ;Expire
86400 ;Minimum TTL

)


IN NS asd.pure.world.
IN PTR pure.world.
IN A 255.255.255.90
80 IN PTR asd.pure.world.
~
~
~
~
~
~
~
"/var/named/80.0.168.192.db" 17L, 408C
/etc/rc.d/init.d/named start
Quote:
[root@asd ~]# /etc/rc.d/init.d/named start
Starting named: [ OK ]
[root@asd ~]# chkconfig named on
[root@asd ~]#
vi /etc/resolv.conf
Quote:

E325: ATTENTION
Found a swap file by the name "/etc/.resolv.conf.swp"
owned by: root dated: Wed Dec 28 08:48:21 2011
file name: /etc/resolv.conf
modified: YES
user name: root host name: asd.pure.world
process ID: 2574
While opening file "/etc/resolv.conf"
dated: Wed Dec 28 08:18:35 2011

(1) Another program may be editing the same file.
If this is the case, be careful not to end up with two
different instances of the same file when making changes.
Quit, or continue with caution.

(2) An edit session for this file crashed.
If this is the case, use ":recover" or "vim -r /etc/resolv.conf"
to recover the changes (see ":help recovery").
If you did this already, delete the swap file "/etc/.resolv.conf.swp"
to avoid this message.
"/etc/resolv.conf" 10L, 246C
Press ENTER or type command to continue
when I press enter
Quote:
# Generated by NetworkManager
search pure.world


# No nameservers found; try putting DNS servers into your
# ifcfg files in /etc/sysconfig/network-scripts like so:
#
# DNS1=xxx.xxx.xxx.xxx
# DNS2=xxx.xxx.xxx.xxx
# DOMAIN=lab.foo.com bar.foo.com
~
~
~
~
~
~
~
~
~
~
~
~
~
so where are the mistacks
 
  


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
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
CentOS Server - How to configure DNS redh Linux - Server 4 11-02-2010 01:41 AM
[SOLVED] How to configure DNS master server on centos shridhar005 Linux - Newbie 3 10-31-2010 08:00 PM
how to configure another dns server to combine use with primary current dns server. hocheetiong Linux - Newbie 1 05-29-2008 06:57 PM
problom with X server and Vmware TheShadow Linux - Newbie 0 09-08-2003 03:48 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 05:28 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