LinuxQuestions.org
Share your knowledge at the LQ Wiki.
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 02-07-2012, 11:30 PM   #1
huchkom
LQ Newbie
 
Registered: Feb 2012
Posts: 3

Rep: Reputation: Disabled
Unhappy How to Config CentOS 6 DNS Server ?


Config Zimbra Mail Server on CentOS 6 tested using a private ip do it, but some are public ip and still do not understand the set of cases that make the DNS be - send it to config files like /etc/host , named.conf, /etc/resolv.conf (IP ?) Zone file and set the Server Network Interface ip address 192.168.xx.xx Firewall NAT on the outside of the Public ip 203.146.xx.xx ISP cand domain already. I need to set up the domain was registered as the DNS1, DNS2 or not.
 
Old 02-08-2012, 02:09 AM   #2
deep27ak
Senior Member
 
Registered: Aug 2011
Location: Bangalore, India
Distribution: rhel 5x,6.0,6.2, centOS 5x,6.0,6.2
Posts: 1,194
Blog Entries: 4

Rep: Reputation: 221Reputation: 221Reputation: 221
I don't think I get you completely but my guess with your tittle you plan to configure DNS server with Public IP and perform NAT on that.

Well lots of questions but you have not mentioned what all you have tried as I am sure if you hit a google search on your tittle you will get hundred of websites eagerly waiting to help you
 
Old 02-08-2012, 02:57 AM   #3
huchkom
LQ Newbie
 
Registered: Feb 2012
Posts: 3

Original Poster
Rep: Reputation: Disabled
/etc/hosts

192.168.x.x doiinthanon.maceducation.info doiinthanon
192.168.x.x mail.maceducation.info mail
127.0.0.1 localhost.localdomain localhost doiinthanon
::1 doiinthanon.maceducation.info doiinthanon localhost6.localdomain6 localhost6
203.146.x.x doiinthanon.maceducation.info doiinthanon
203.146.x.x mail.maceducation.info mail

/etc/resolv.conf

# Generated by NetworkManager
search maceducation.info
#nameserver 192.168.x.x
nameserver 203.146.x.x
nameserver 203.146.237.237 (ISP)



/var/named/chroot/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; 192.168.x.x; };
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";
allow-query { any; };
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.x.x/24;
};

zone "." IN {
type hint;
file "named.ca";
};

zone "maceducation.info" IN {
type master;
file "maceducation.info.lan";
allow-update { none; };
};

zone "x.168.192.in-addr.arpa" IN {
type master;
file "101.168.192.db";
allow-update { none; };
};


include "/etc/named.rfc1912.zones";

};

view "external" {
match-clients { any; };
allow-query { any; };
recursion no;
zone "maceducation.info" IN {
type master;
file "maceducation.info.wan";
allow-update { none; };
};
zone "x.x.146.203.in-addr.arpa" IN {
type master;
file "x.x.146.203.db";
allow-update {none; };
};
};


/var/named/maceducation.info.lan

;
; Addresses and other host information.
;

$TTL 86400
@ IN SOA doiinthanon.maceducation.info. root.maceducation.info. (
2011030801 ;Serial
43200 ;Refresh
3600 ;Retry
3600000 ;Expire
259200 ;Minimum TTL
)

; Define the nameservers

IN NS doiinthanon.maceducation.info.
; Define internal IP Address of name server

IN A 192.168.x.x

; Define Mail exchanger
IN MX 10 mail.maceducation.info.


; Define IP address and hostname

doiinthanon IN A 192.168.x.x
mail IN A 192.168.x.x
~


/var/named/x.x.192.db


;
; Addresses and other host information.
;

$TTL 86400
@ IN SOA doiinthanon.maceducation.info. root.maceducation.info. (
2011030801 ;Serial
43200 ;Refresh
3600 ;Retry
3600000 ;Expire
259200 ;Minimum TTL
)

;Define the nameservers and the mail servers

IN NS doiinthanon.maceducation.info.

;Define range that this domain name is in
IN PTR maceducation.info.
IN A 255.255.255.0

;Define IP Address and hostname
x IN PTR doiinthanon.maceducation.info.
x IN PTR mail.maceducation.info.



/var/named/maceducation.info.wan


;
; Addresses and other host information.
;

$TTL 86400
@ IN SOA doiinthanon.maceducation.info. root.maceducation.info. (
2011030801 ;Serial
43200 ;Refresh
3600 ;Retry
3600000 ;Expire
259200 ;Minimum TTL
)

; Define the nameservers

IN NS doiinthanon.maceducation.info.
; Define external IP Address of name server

IN A 203.146.x.x

; Define Mail exchanger
IN MX 10 mail.maceducation.info.


; Define IP address and hostname

doiinthanon IN A 203.146.x.x
mail IN A 203.146.x.x



/var/named/x.x.146.203.db


;
; Addresses and other host information.
;

$TTL 86400
@ IN SOA doiinthanon.maceducation.info. root.maceducation.info. (
2011030801 ;Serial
43200 ;Refresh
3600 ;Retry
3600000 ;Expire
259200 ;Minimum TTL
)

;Define the nameservers and the mail servers

IN NS doiinthanon.maceducation.info.

;Define range that this domain name is in
IN PTR maceducation.info.
IN A 255.255.255.240

;Define IP Address and hostname
x IN PTR doiinthanon.maceducation.info.
x IN PTR mail.maceducation.info.

RESULT

[root@doiinthanon ~]# service named restart
Stopping named: .[ OK ]
Starting named: [ OK ]

~
[root@doiinthanon ~]# dig maceducation.info

; <<>> DiG 9.7.3-P3-RedHat-9.7.3-8.P3.el6_2.2 <<>> maceducation.info
;; global options: +cmd
;; connection timed out; no servers could be reached

[root@doiinthanon ~]# dig maceducation.info @203.146.x.x

; <<>> DiG 9.7.3-P3-RedHat-9.7.3-8.P3.el6_2.2 <<>> maceducation.info @203.146.x.x
;; global options: +cmd
;; connection timed out; no servers could be reached


; <<>> DiG 9.7.3-P3-RedHat-9.7.3-8.P3.el6_2.2 <<>> maceducation.info @192.168.x.x
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 64994
;; flags: qr aa rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 1, ADDITIONAL: 1

;; QUESTION SECTION:
;maceducation.info. IN A

;; ANSWER SECTION:
maceducation.info. 86400 IN A 192.168.x.x

;; AUTHORITY SECTION:
maceducation.info. 86400 IN NS doiinthanon.maceducation.info.

;; ADDITIONAL SECTION:
doiinthanon.maceducation.info. 86400 IN A 192.168.x.x

;; Query time: 0 msec
;; SERVER: 192.168.x.x#53(192.168.x.x)
;; WHEN: Wed Feb 8 14:58:42 2012
;; MSG SIZE rcvd: 93


I register DOMAIN maceducation.info and unnecessary Internal DNS
 
Old 02-08-2012, 03:31 AM   #4
deep27ak
Senior Member
 
Registered: Aug 2011
Location: Bangalore, India
Distribution: rhel 5x,6.0,6.2, centOS 5x,6.0,6.2
Posts: 1,194
Blog Entries: 4

Rep: Reputation: 221Reputation: 221Reputation: 221
I see that you have commented the internal IP in resolv.conf and you are creating zone files for

your public IP as well as Private IP?

Do you want to use your internal Ip as DNS server or you want to configure DNS suing Public IP?

Please be clear so that I can mark out some errors in your zone files
 
Old 02-08-2012, 04:14 AM   #5
huchkom
LQ Newbie
 
Registered: Feb 2012
Posts: 3

Original Poster
Rep: Reputation: Disabled
I follow http://www.server-world.info/en/note?os=CentOS_6&p=dns

I have public ip at firewall NAT 1:1 203.146.x.x = 192.168.x.x

I don't understand config /etc/host/ /etc/resolv.conf what ip? if I have one ip interfacae 192.168.x.x

[root@doiinthanon ~]# nslookup
> maceducation.info
;; Got SERVFAIL reply from 203.146.237.237, trying next server
;; connection timed out; no servers could be reached
 
Old 02-08-2012, 04:24 AM   #6
deep27ak
Senior Member
 
Registered: Aug 2011
Location: Bangalore, India
Distribution: rhel 5x,6.0,6.2, centOS 5x,6.0,6.2
Posts: 1,194
Blog Entries: 4

Rep: Reputation: 221Reputation: 221Reputation: 221
ok so taking 192.168.x.x as your internal IP and which is NAT to some public IP
you want to configure DNS on 192.168.0.10



Code:
vi /etc/resolv.conf
nameserver 192.168.0.10
Code:
#vi named.conf
listen-on port 53 { 127.0.0.1; 192.168.0.10; };  <--uncomment this
Code:
(these lines are not required)
zone "x.x.146.203.in-addr.arpa" IN {
type master;
file "x.x.146.203.db";
allow-update {none; };
};
Code:
/var/named/0.168.192.db

;
; Addresses and other host information.
;

$TTL 86400
@ IN SOA doiinthanon.maceducation.info. root.maceducation.info. (
2011030801 ;Serial
43200 ;Refresh
3600 ;Retry
3600000 ;Expire
259200 ;Minimum TTL
)

;Define the nameservers and the mail servers

IN NS doiinthanon.maceducation.info.

;Define range that this domain name is in
10      IN PTR maceducation.info.

#service named restart


Code:
#dig -x 192.168.0.10
for further help follow this link
http://www.linuxquestions.org/questi...se-zone-24628/

Last edited by deep27ak; 02-08-2012 at 04:51 AM.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 server on centos 6.0-Help!!!! Tosani19 Linux - Server 5 10-24-2011 07:54 PM
[SOLVED] Config DNS server who i am Linux - Server 10 02-14-2011 04:19 AM
2 Subnet 1 httpd server and 2 dns server how to config? ramnit Linux - Networking 1 06-15-2009 12:33 AM
config dns server tuananh87vn Debian 10 04-10-2009 10:24 AM


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