LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Bind centos config help (https://www.linuxquestions.org/questions/linux-newbie-8/bind-centos-config-help-4175472090/)

Scubasjl 08-04-2013 04:22 PM

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


Habitual 08-04-2013 07:49 PM

Quote:

Originally Posted by Scubasjl (Post 5002811)
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...

Scubasjl 08-04-2013 08:10 PM

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.

SAbhi 08-04-2013 09:19 PM

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.

Habitual 08-04-2013 09:46 PM

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!

Scubasjl 08-05-2013 01:05 PM

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.


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