Find the answer to your Linux question:
Results 1 to 10 of 10
Hi, I have installed centos5.4 on my server and has set up a bind9.6 to resolve host names inside my lan network. I have some question and hope some on ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    Mar 2010
    Posts
    6

    [SOLVED] resolv.conf


    Hi, I have installed centos5.4 on my server and has set up a bind9.6 to resolve host names inside my lan network. I have some question and hope some on could give me an advice.
    I have configured named.conf and resolv.conf like below

    acl "lan" {
    192.168.13.0/24;
    192.168.12.0/24;
    192.168.11.0/24;
    127.0.0.1;
    };
    acl "secondary" {
    192.168.11.12;
    192.168.13.12;
    };



    options {
    directory "/usr/local/namedb";
    allow-recursion {lan;};
    allow-query {lan;};
    };
    view "lan" {
    match-clients {lan;};

    zone "." {
    type hint;
    file "db.local";
    };

    zone "example.lan" {
    type master;
    file "primary/db.example.lan";
    allow-transfer { secondary;};
    };
    zone "168.192.in-addr.arpa" {
    type master;
    file "primary/db.168.192.in-addr.arpa";
    allow-transfer { secondary;};
    };
    };

    cat /etc/resolv.conf

    domain example.lan
    nameserver 127.0.0.1

    inside db.example.lan, has hostname of ns1.example.lan ns2.examle.lan test.example.lan.

    on my server, i can resolve with both "ns1.example.lanand" "ns1"
    but on my clients inside lan network, i can resolve only with "ns1.example.lan"
    when i try to resolve "ns1" it fails.

    how could i configure to resolve with "ns1" on my clients?
    i thought about editing hosts file on clients but i want to use nameserver.

  2. #2
    mzv
    mzv is offline
    Just Joined!
    Join Date
    Aug 2009
    Location
    Evil Empire
    Posts
    33
    Do you have something like this?
    Code:
    cat /etc/hosts
    127.0.0.1               localhost.network.lan    localhost
    192.168.10.31       myserver.network.lan    myserver
    192.168.10.112     mydns.network.lan        mydns

  3. #3
    Linux Guru Lazydog's Avatar
    Join Date
    Jun 2004
    Location
    The Keystone State
    Posts
    2,672
    Bind has no knowledge of short names, which is what you are looking to do.
    On every client you want to use short names add in your resolve.conf file the search line at the top as follows:

    Code:
    search example.lan

    Regards
    Robert

    Linux
    The adventure of a life time.

    Linux User #296285
    Get Counted

  4. #4
    Just Joined!
    Join Date
    Mar 2010
    Posts
    6
    Hi mzv,
    thanks for the responce.
    I also have view "wan" section in named.conf and inside that i use ns1.example.com as hostname.
    I have written external domain for hosts name on server.
    cat /etc/host

    127.0.0.1 localhost
    127.0.0.1 ns1 ns1.example.com
    ::1 localhost6.localdomain6 localhost6

  5. #5
    Just Joined!
    Join Date
    Mar 2010
    Posts
    6
    hi, Lazydog
    so resolv.conf only works for client its self?
    like in cases with 100 or more clients in lan netwrok,
    are there a way to use short name with out every one
    edit their resolv.conf?

  6. #6
    Linux Guru Lazydog's Avatar
    Join Date
    Jun 2004
    Location
    The Keystone State
    Posts
    2,672
    Not that I am aware of. You need to edit resolv.conf to use short names.

    Regards
    Robert

    Linux
    The adventure of a life time.

    Linux User #296285
    Get Counted

  7. #7
    Just Joined!
    Join Date
    Mar 2010
    Posts
    6
    thank you for your help.
    my clients in network are windows clients.
    So I will look for other way to solve this problem

  8. #8
    Linux Guru Lazydog's Avatar
    Join Date
    Jun 2004
    Location
    The Keystone State
    Posts
    2,672
    For windows you need to edit the interface and configure the search domains there under Advance. Not sure if this can be done through dhcp.

    Regards
    Robert

    Linux
    The adventure of a life time.

    Linux User #296285
    Get Counted

  9. #9
    Just Joined!
    Join Date
    Mar 2010
    Posts
    6
    Hi,
    currently I'm configuring each interface with static ip address.
    I'll try to setup the dhcp server and see if i could do as i like.

    thanks

  10. #10
    Just Joined!
    Join Date
    Mar 2010
    Posts
    6
    sorry, that my reply got so late.
    finally the problem solved.
    I have configured dhcp with
    option domain-name "example.com"
    now I could access to my servers with only hostname.
    thank you very much for many helps

Posting Permissions

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