bind server problem

Discussion in 'Linux Networking' started by Julien Mills, May 22, 2012.

  1. Julien Mills

    Julien Mills Guest

    Hey all,

    I have a caching bind dns (and dhcpd) server running on a Slackware box.
    It works great, almost.

    My website is hosted off-site.

    In a browser when I type: it works, I get to my website.
    If I type (without the www) it does not work.

    Does anyone know how I can set up the dns to make this work?

    Julien Mills, May 22, 2012
    1. Advertisements

  2. Julien Mills

    Jorgen Grahn Guest

    Do you want to resolve only when you use your caching name
    server, or do you want it to work for everyone, from anywhere? I'm
    pretty sure a caching-only name server can't make the latter happen.

    Jorgen Grahn, May 22, 2012
    1. Advertisements

  3. Julien Mills

    Whiskers Guest

    Have you got an entry specifically for but not for the
    Whiskers, May 22, 2012
  4. Julien Mills

    Julien Mills Guest

    Not quite sure what you mean. I want it work for all our users behind our
    firewall. Our dns server is only available locally. Is that what you


    Julien Mills, May 23, 2012
  5. Julien Mills

    Julien Mills Guest

    There's an entry for www and an entry for

    www A A

    I believe that bind automatically put them in there, is that possible?

    Just did a little testing, from a Windows machine here on our network works, does not. This makes no sense to me.

    I want both to work, mainly because Google is returning so I
    want that to work.
    Julien Mills, May 23, 2012
  6. Julien Mills

    Jorgen Grahn Guest

    Yes, that was what was unclear. The part about users behind a firewall
    was missing from the original question.

    Jorgen Grahn, May 23, 2012
  7. Julien Mills

    Joe Pfeiffer Guest

    Unless you've got a good reason to use bind I highly recommend switching
    to dnsmasq. It's roughly an order of magnitude easier to configure.

    As to your particular problem, it's hard to guess what's going on from
    two lines plucked from your config file. But, if those two lines are
    really next to each other, I'm guessing they're inside a zone defined
    for If I'm right in that guess, you've defined resource
    records for and If you
    replace the second line with

    @ A

    it should work (the @ says 'use the root of the domain').

    Also, if you'd used A

    (note the period after the hostname) is would have worked.
    Joe Pfeiffer, May 23, 2012
  8. Julien Mills

    Chris Davies Guest

    What do you mean by "it does not work"? There are at least two different
    potential issues here.

    1. DNS entries: is there a DNS 'A' record for both
    and, and do both resolve to the same IP address. (This
    is what the other posts here seem to be concentrating on.)

    2. Web configuration: many websites these days are configured to be
    able to run multiple websites from the same IP address. Consequently,
    unless you tell the webserver to accept requests for
    AND, it won't have any content to deliver to you.

    You can confirm #1 by running the following commands and visually
    confirming that you get the same external address reported for both

    dig +short a
    dig +short a

    You can confirm #2 either by checking the configuration files for your
    webserver, or empirically as follows. First, you need to obtain the
    correct IP address for your server. In this example I'm going to assume


    nc -vvv 80 # "telnet 80"
    GET / HTTP/1.0

    nc -vvv 80
    GET / HTTP/1.0

    In both cases you'll need to hit Return a couple of times at the end
    (i.e. there needs to be a blank line after the Host: line).

    If you get the same content from both requests then your web server is
    configured as you hope. If you don't then it isn't.

    Chris Davies, May 24, 2012
  9. Julien Mills

    Julien Mills Guest

    You are exactly correct in everything you say here, your guesses and
    conclusions. Both of your solutions work perfectly.

    Thank you very much. I am so glad to get this going.

    Thanks again.
    Julien Mills, May 24, 2012
  10. Julien Mills

    Julien Mills Guest


    Thank you for this helpful answer. It turns out my problem is #1, dns
    entries for my web site were not working, Joe helped me fix that. I like
    the "+short a", makes it neater.

    And I ran your tests for #2, it turns out the web site is configured to
    handle both cases properly which is good to know. Thanks for those
    tests. nc is very useful.

    Julien Mills, May 24, 2012
  11. Julien Mills

    Chris Davies Guest

    No problem.

    Nc (aka netcat) is a very powerful tool for building or testing network
    connections. It's worth taking a look at its capabilities (don't aim
    to memorise the manual though!) so you know what's possible. Socat is
    another really useful network tool, but IMO the syntax is complex and
    really hard to get one's head around.

    Chris Davies, May 24, 2012
  12. Julien Mills

    Joe Pfeiffer Guest

    You're very welcome!
    Joe Pfeiffer, May 25, 2012
    1. Advertisements

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.