Can somebody help me getting Bind to work on Centos 5?

Discussion in 'Server Operation' started by treeman, Aug 13, 2009.

  1. treeman

    treeman New Member

    I have set up bind on a centos 5 box on my network to act as a dns for my domain.
    Bind is installed and starting ok.

    This is my setup:

    WAN "mywanip" -> ROUTER -> NAT:53 -> Centos 5 ""
    When i use online port checking tools it shows as connection successfull on port 53 WAN ip so I am assuming there is no problem there. -> Nameserver = "mywanip"

    when I "ping" I get reply from "mywanip"

    when I "host" I get : has address "mywanip"
    Host not found: 3(NXDOMAIN)
    Host not found: 3(NXDOMAIN)

    when I "host" from Centos5 box I get: has address "mywanip"
    Host not found: 2(SERVFAIL)
    Host not found: 2(SERVFAIL)

    I am still new to Bind so I am guessing its my zone files that are not right, altho I have experimented with a few configurations that I found in tutorials but this is the furthest I can get.

    Here is a copy of my named.conf and zone files:

    Any tips or observations would be helpfull, thank you
  2. falko

    falko Super Moderator ISPConfig Developer

    Code: IN NS IN NS
    must be
    Code:[B][COLOR="Red"].[/COLOR][/B] IN NS[B][COLOR="Red"].[/COLOR][/B] IN NS
    Did you check your zone on ?
  3. treeman

    treeman New Member

    I tried that but still same result. I got the following errors from the dns report

    Is there anything else to look at except named.conf and zone files?
  4. treeman

    treeman New Member

    It just occoured to me that my port 80 is being blocked by my isp. But I am not trying to host a web page, just testing and learning DNS, would the ns record get blocked by the port 80 block? Port 53 is not blocked and forwarded through my router to correct internal IP

    Update: I tried with the centos 5 box off and i got

    ;; connection timed out; no servers could be reached
    ;; connection timed out; no servers could be reached

    With the centos 5 box on i got

    Host not found: 3(NXDOMAIN)
    Host not found: 3(NXDOMAIN)

    So i guess its getting through just the zone file not working properly
    Last edited: Aug 15, 2009
  5. falko

    falko Super Moderator ISPConfig Developer

  6. treeman

    treeman New Member

    Is there any way to do it without setting a glue record? I just want to set up a simple basic dns that will work with my domain.

    I went through alot of guides for bind on centos and none mentioned glue records
  7. falko

    falko Super Moderator ISPConfig Developer

    If you don't want to create a glue record, you must host the zone on name servers that don't use in their hostname (i.e., instead of and use and
  8. treeman

    treeman New Member

    sorry but I am not sure what to use for "example" in ns1.example
  9. falko

    falko Super Moderator ISPConfig Developer

    Any domain other than
  10. treeman

    treeman New Member

    Hi, thanx for trying to help, I am still stuck so I must be doing something wrong with the basics or my whole understanding of dns. So i got myself a book apress - pro dns and bind and im going to start from scratch, thanx for your help
  11. falko

    falko Super Moderator ISPConfig Developer

  12. treeman

    treeman New Member

    Thanks for the post, the guide is really good and the easiest to understand from what I have found so far. Really good on the details, so after reading it a few times I was so confident ill get it going I started from scratch and now I am stuck in the same place:(

    I must be missing something that I failed to see, this is what I have done from the very beginning:

    1. Registered a domain at
    2. Set the name servers linked to my domain as: -> wan ip -> wan ip -> wan ip
    just for the sake of it i put in wont hurt right?

    3. After doing this and waiting for the records to update when i type in host or I get my wan ip back, this is good I presume now the domain knows where to look for the dns server.

    4. Install bind use system-config-bind to get all my config files in right places.
    5. Start bind to make sure its running - OK
    6.. Edit and, didn't edit nothing in named.conf or change zone file names, I hope this is ok just for testing
    7. Make sure my wan ip port 53 is nat to internal dns server port 53, this looks to be working ad online tools tell me port 53 is open.
    8. So now in my mind this is the picture I have when a query is made to my domain
    user contacts domain, domain says this is the dns server and gives user or since I put them all in step 2. User is redirected to those addresses which both resolve to my wan ip. User queries my wanip on port 53 and talks to bind. So bind should now read out my zone files and translate what is set in them to the user?
    But when i type in it does not work, when i try host I get either
    Host not found: 2(SERVFAIL)
    connection timed out; no servers could be reached

    Im lost, I must of missed something in my setup, I know you mentioned glue records but I want to keep it as simple as possible, I tried a few different possiblities for ns but nothing. sorry to be annoying
  13. treeman

    treeman New Member

    Im such a jackass lol

    As simple as it was the problem was my external zone in named.conf was not the same as my nameserver at my domain so naturally no nameserver could be contacted and soa record retreived. Right now I am getting a almost perfect report from just a few minor thing associated with using single ip etc.

    Well i guess it was that plain that nobody mentioned it in any guide and I simply missed it, hope this can save somebody alot of pain and long nights, thanx Falco for giving me support
    Last edited: Aug 29, 2009

Share This Page