LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
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 08-04-2013, 04:22 PM   #1
Scubasjl
LQ Newbie
 
Registered: Aug 2013
Posts: 3

Rep: Reputation: Disabled
Bind centos config help


Running VPS with Centos 6.4, installed BIND
I can access the website/server with the ip address. The domain name is not working, would like to resolve this. What I currently have:

nslookup results

IP:
Code:
nslookup 1xx.2xx.2xx.1xx
Server:         8.8.8.8
Address:        8.8.8.8#53

Non-authoritative answer:
1xx.2xx.2xx.1xx.in-addr.arpa    name = 1xx.2xx.2xx.1xx.static.quadranet.com.
Domain Name:
Code:
nslookup www.mydomain.com                                       
;; Got SERVFAIL reply from 8.8.8.8, trying next server
;; Got SERVFAIL reply from 8.8.8.8, trying next server
Server:         8.8.4.4
Address:        8.8.4.4#53
named.conf
Code:
options {
	listen-on port 53 { 127.0.0.1; };
	listen-on-v6 port 53 { ::1; };
	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; };
	recursion yes;

	dnssec-enable yes;
	dnssec-validation yes;
	dnssec-lookaside auto;

	/* Path to ISC DLV key */
	bindkeys-file "/etc/named.iscdlv.key";

	managed-keys-directory "/var/named/dynamic";
};

logging {
        channel default_debug {
                file "data/named.run";
                severity dynamic;
        };
};

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

zone "mydomain.com" {
	type master;
	file "mydomain.com.hosts";
	allow-transfer {
		127.0.0.1;
		localnets;
		};
	};

include "/etc/named.rfc1912.zones";
include "/etc/named.root.key";
mydomain.com.hosts
Code:
$ttl 38400
@	IN	SOA	ns.mydomain.com. root.ns.mydomain.com. (
			1375467856
			10800
			3600
			604800
			38400 )
@	IN	NS	ns.mydomain.com.
mydomain.com.	IN	A	1xx.2xx.2xx.1xx
www.mydomain.com.	IN	A	1xx.2xx.2xx.1xx
ftp.mydomain.com.	IN	A	1xx.2xx.2xx.1xx
m.mydomain.com.	IN	A	1xx.2xx.2xx.1xx
ns.mydomain.com.	IN	A	1xx.2xx.2xx.1xx
localhost.mydomain.com.	IN	A	127.0.0.1
webmail.hangingbelow.com.	IN	A	1xx.2xx.2xx.1xx
admin.hangingbelow.com.	IN	A	1xx.2xx.2xx.1xx
mail.hangingbelow.com.	IN	A	1xx.2xx.2xx.1xx
hangingbelow.com.	IN	MX	5 mail.mydomain.com.
hangingbelow.com.	IN	TXT	"v=spf1 a mx a:mydomain.com ip4:1xx.2xx.2xx.1xx ?all"
resolv.conf
Code:
nameserver 8.8.8.8
nameserver 8.8.4.4
 
Old 08-04-2013, 07:49 PM   #2
Habitual
LQ Addict
 
Registered: Jan 2011
Posts: 7,828
Blog Entries: 11

Rep: Reputation: 2111Reputation: 2111Reputation: 2111Reputation: 2111Reputation: 2111Reputation: 2111Reputation: 2111Reputation: 2111Reputation: 2111Reputation: 2111Reputation: 2111
Quote:
Originally Posted by Scubasjl View Post
Code:
$ttl 38400
@	IN	SOA	ns.mydomain.com. root.ns.mydomain.com. (
			1375467856
Where are your domain's nameserver pointed?
Code:
host -t ns mydomain.com
1375467856 looks "made up"
The standard convention is to use the date of update YYYYMMDDnn, where nn is a revision number in case more than one updates are done in a day. So if the first update done today would be 2005301200 and second update would be 2005301201.
DNS does not care if you are running CentOS or ToasterOS, so read it carefully and learn the concepts.

Does this output show your host's IP?
Code:
host -t ns mydomain.com | while read dom ns server; do dig +short $dom; done
Until the Nameserver IP at the Registrar is pointed at the IP of your Bind host, it is likely to not get routed to your box.
Assuming the Bind host and the domain are on the same host.

https://help.ubuntu.com/12.04/serverguide/dns.html
http://www.debianhelp.co.uk/dnsrecords.htm

Please let us know...
 
Old 08-04-2013, 08:10 PM   #3
Scubasjl
LQ Newbie
 
Registered: Aug 2013
Posts: 3

Original Poster
Rep: Reputation: Disabled
Code:
host -t ns mydomain.com
Returns:
Host mydomain.com not found: 2(SERVFAIL)

1375467856 was from the hosts file, when I installed centos 5.8 with virtual/webmin on the vps. When I go through the virtualmin and add a virtual server it sets up the dns and it works then. So I copied a few files so I can compare and have a working example to go off of.

The Nameserver IP at the Registrar is pointed at the IP of my Bind host.
 
Old 08-04-2013, 09:19 PM   #4
SAbhi
Member
 
Registered: Aug 2009
Location: Bangaluru, India
Distribution: CentOS 6.5, SuSE SLED/ SLES 10.2 SP2 /11.2, Fedora 11/16
Posts: 664

Rep: Reputation: 80
See if the inlines below can help you.

Quote:
options {
listen-on port 53 { 127.0.0.1; [your_master_dns_ip_goes_here]; };
listen-on-v6 port 53 { ::1; };
Quote:
zone "mydomain.com" {
type master;
file "mydomain.com.hosts";
allow-transfer {
127.0.0.1; [your_master_dns_ip_goes_here]; # always allow transfer from your master along with localnets
localnets;
};
};

Quote:
resolv.conf


Code:
nameserver 8.8.8.8
nameserver 8.8.4.4
is that your resolver file contains hopefully these were your DNS's name server IP as in the zone file config I can only see one name server defined with 1xx.xxx.xxx.xxx , if not you need to replace them.

Last edited by SAbhi; 08-04-2013 at 09:20 PM.
 
Old 08-04-2013, 09:46 PM   #5
Habitual
LQ Addict
 
Registered: Jan 2011
Posts: 7,828
Blog Entries: 11

Rep: Reputation: 2111Reputation: 2111Reputation: 2111Reputation: 2111Reputation: 2111Reputation: 2111Reputation: 2111Reputation: 2111Reputation: 2111Reputation: 2111Reputation: 2111
Try this and let us know the output.
Code:
dig +short domain.com @your_bind_host_ip
But you said "The Nameserver" as if there is only one?

Nameservers pointed at your bind host is a great start!
 
Old 08-05-2013, 01:05 PM   #6
Scubasjl
LQ Newbie
 
Registered: Aug 2013
Posts: 3

Original Poster
Rep: Reputation: Disabled
I have it working now.

named.conf I changed to this
Code:
options {
    directory "/etc";
    pid-file "/var/run/named/named.pid";
    allow-recursion { localnets; 127.0.0.1; };
    };

zone "." {
    type hint;
    file "/etc/db.cache";
    };

zone "mydomain.com" {
	type master;
	file "/var/named/mydomain.com.hosts";
	allow-transfer {
		127.0.0.1;
		localnets;
		};
	};
resolv.conf added 127.0.0.1 and 8.8.8.8 and 8.8.4.4 are google public dns
Code:
nameserver 8.8.8.8
nameserver 8.8.4.4
nameserver 127.0.0.1
Since I called for the db.cache
Code:
;       This file holds the information on root name servers needed to
;       initialize cache of Internet domain name servers
;       (e.g. reference this file in the "cache  .  <file>"
;       configuration file of BIND domain name servers).
;
;       This file is made available by InterNIC 
;       under anonymous FTP as
;           file                /domain/named.root
;           on server           FTP.INTERNIC.NET
;
;       last update:    Nov 5, 2002
;       related version of root zone:   2002110501
;
;
; formerly NS.INTERNIC.NET
;
.                        3600000  IN  NS    A.ROOT-SERVERS.NET.
A.ROOT-SERVERS.NET.      3600000      A     198.41.0.4
;
; formerly NS1.ISI.EDU
;
.                        3600000      NS    B.ROOT-SERVERS.NET.
B.ROOT-SERVERS.NET.      3600000      A     128.9.0.107
;
; formerly C.PSI.NET
;
.                        3600000      NS    C.ROOT-SERVERS.NET.
C.ROOT-SERVERS.NET.      3600000      A     192.33.4.12
;
; formerly TERP.UMD.EDU
;
.                        3600000      NS    D.ROOT-SERVERS.NET.
D.ROOT-SERVERS.NET.      3600000      A     128.8.10.90
;
; formerly NS.NASA.GOV
;
.                        3600000      NS    E.ROOT-SERVERS.NET.
E.ROOT-SERVERS.NET.      3600000      A     192.203.230.10
;
; formerly NS.ISC.ORG
;
.                        3600000      NS    F.ROOT-SERVERS.NET.
F.ROOT-SERVERS.NET.      3600000      A     192.5.5.241
;
; formerly NS.NIC.DDN.MIL
;
.                        3600000      NS    G.ROOT-SERVERS.NET.
G.ROOT-SERVERS.NET.      3600000      A     192.112.36.4
;
; formerly AOS.ARL.ARMY.MIL
;
.                        3600000      NS    H.ROOT-SERVERS.NET.
H.ROOT-SERVERS.NET.      3600000      A     128.63.2.53
;
; formerly NIC.NORDU.NET
;
.                        3600000      NS    I.ROOT-SERVERS.NET.
I.ROOT-SERVERS.NET.      3600000      A     192.36.148.17
;
; operated by VeriSign, Inc. 
;
.                        3600000      NS    J.ROOT-SERVERS.NET.
J.ROOT-SERVERS.NET.      3600000      A     192.58.128.30
;
; housed in LINX, operated by RIPE NCC
;
.                        3600000      NS    K.ROOT-SERVERS.NET.
K.ROOT-SERVERS.NET.      3600000      A     193.0.14.129 
;
; operated by IANA
;
.                        3600000      NS    L.ROOT-SERVERS.NET.
L.ROOT-SERVERS.NET.      3600000      A     198.32.64.12
;
; housed in Japan, operated by WIDE
;
.                        3600000      NS    M.ROOT-SERVERS.NET.
M.ROOT-SERVERS.NET.      3600000      A     202.12.27.33
; End of File
I'm pretty sure this is not the way to do it, but it works and any suggestions on making this better would be helpful.
 
  


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
[SOLVED] Need a hand with bind config bjw122 Linux - Server 9 05-12-2013 06:57 AM
Bind problem: config files are missing after re-install bind 9.5 on Fedora Core 8 elvisious Linux - Software 1 07-15-2008 07:49 PM
CentOS 5.1 Bind config ratcateme Linux - Software 1 02-01-2008 10:06 PM
Need help with BIND config on RHEL4 nogden Linux - Server 7 11-15-2007 03:29 PM
Bind config tool serverjunkie Linux - Software 0 01-18-2006 04:47 AM


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