Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

BIND - DNS and MX Records
New on LowEndTalk? Please Register and read our Community Rules.

BIND - DNS and MX Records

aubsaubs Member
edited March 2012 in Help

Hi all, I've been playing around with DNS, but for some reason, can't seem to resolve what I'm aiming for.

Basically, I want to have MX entries (pointing to google's servers) but also to have a website.

This works on its own:
... so I can use it as a website which points to the main website as anyway (yes, I could get away with using * IN CNAME, but if I wanted it pointing elsewhere this wouldn't work).

This works on its own: IN MX 1 I can have emails directed to google.

The trouble is, I can't seem to have them both together. Am I missing something?

I appreciate sub is the same as


  • dmmcintyre3dmmcintyre3 Member
    edited March 2012

    you can't mix CNAMEs with other records. Use an A (and AAAA if IPv6 is used) record instead of CNAME to point it to your webserver.

    Thanked by 1aubs
  • aubsaubs Member

    Excellent, thank you @dmmcintyre3 - Should have known that really :)

  • I dunno if it is how you are typing stuff, but my first reaction is you are missing a trailing dot on your CNAME

  • aubsaubs Member
    edited March 2012

    @miTgiB : Thanks for that, I did actually have a trailing dot in the file but for some reason didn't copy it over (though I did miss it in two examples!). For others who this may be of use (I learnt this at my old job!) ... Fully qualified domain names need the dot or the domain name is appended. Examples: would become [wrong] would become [right]
    sub. would become sub [wrong]
    sub would become [right]

  • aubsaubs Member

    Hi, hopefully someone will have insight in to this.
    Edit /etc/bind/named.conf.local and add the following:

    zone "" {
            type master;
            notify no;
            file "/etc/bind/db.192";

    All documentation I have seen regarding this always show local IP addresses, such as in the example 192.168.1.x, but never explain if this needs to be the publicly accessible IP if it is for public DNS (as opposed to internal DNS). Additionally, different guides specify different file names. the above shows db.192, others show, This one even shows:

    zone "" {
         type master;
         file "/etc/bind/zones/";

    Looks like they both differ completely?

    Am I missing something? Thanks :)

  • The name of the file does not matter.
    Often, the zone files you see are examples.

    If you wanted to provide reverse DNS for IP address AAA.BBB.CCC.DDD and had public delegation for the AAA.BBB.CCC/24 subnet, you could

    in named.conf
    zone "" {
    type master;
    file "/etc/";

  • aubsaubs Member

    Thanks, @judouk

    So if I understand you correctly, if I am setting this up for an internal system (with internal IP's) I can use your example.

    However if I am setting up Bind up for a number of domains I have, so I have more control over the DNS, I shouldn't set up a reverse zone file as I will be hosting more than one domain on a single IP. I will then need to get my ISP / VPS provider to set the rDNS for the IP?

    Sorry if this sounds a bit silly, I'm just making sure I understand it properly.

  • If your ISP has delegated control of the reverse DNS to you, then you would normally need to setup your zone accordingly.

    Try not to confuse forward and reverse ( zones.
    You can have as many records (A, CNAME, MX etc) as you want for one particular IP address but, for the reverse, you should normally only have one.

  • aubsaubs Member

    Thanks for that, makes sense now :)

Sign In or Register to comment.