Find the answer to your Linux question:
Results 1 to 2 of 2
So, I've got Bind9 running and configured on a router which acts as the DNS for my LAN. I want to setup so that when I resolve a hostname, it ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    Sep 2007
    Posts
    22

    BIND9 CNAME/A Records


    So, I've got Bind9 running and configured on a router which acts as the DNS for my LAN.

    I want to setup so that when I resolve a hostname, it goes to a certain IP.

    I currently have:
    $ORIGIN home.mydomain,com. ; designates the start of this zone file in the namespace
    $TTL 1h ; default expiration time of all resource records without their own TTL value
    ;
    ; BIND data file for mydomain,com
    ;
    ;$TTL 604800
    IN SOA home.mydomain,com. home.mydomain,com. (
    2011120301 ; Serial
    7200 ; Refresh
    120 ; Retry
    2419200 ; Expire
    604800) ; Default TTL
    ;

    IN NS localhost.

    ns A 10.0.0.1
    home.mydomain,com. IN A 10.0.0.1
    voip.mydomain,com. IN A 10.0.0.11
    voip IN A 10.0.0.11
    ;winpc IN A 10.0.0.4
    ;voip. mydomain,com. CNAME home.mydomain,com.
    ;ld IN CNAME hotmail,com.
    All hostnames work in my current search domain ($ORIGIN) (So, for example, if I ping winpc, it will resolve to 10.0.0.4)

    I can also type in ld and it will resolve to hotmail,com.

    If I type in home.mydomain,com, it resolve to 10.0.0.1 (Or what ever I set it to), however, if I type in voip.mydomain,com, or any other TLD, or sub-domain, it resolves to what ever my ISP would.

    So, it's only resolving home.mydomain,com, or what ever else I place in the $ORIGIN correctly.

    Is there any way to configure BIND9 to do A records, or CNAME records for all domains?

    Basically, I want it to look in its own internal records, before requesting from the internet, if it can't find a record, then request from ISP.

  2. #2
    Linux Guru Lazydog's Avatar
    Join Date
    Jun 2004
    Location
    The Keystone State
    Posts
    2,672
    Change your $ORIGIN home.mydomain,com. to $ORIGIN mydomain,com..
    Origin is your domain only without a host.
    I would also remove all the mydomain.com. from your zone file as it really isn't needed.

    Regards
    Robert

    Linux
    The adventure of a life time.

    Linux User #296285
    Get Counted

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •