bind issues

Discussion in 'Linux Networking' started by Bill McCormick, Dec 10, 2012.

  1. I having some bind issues, it looks like some things work but not
    others. I also need to have bind resolve entries from /etc/hosts, but
    that's not working either.

    [email protected]:~# host ltx1
    ltx1.hipower.service.fiberio.local has address 172.16.122.211

    but ...

    [email protected]:~# dig ltx1

    ; <<>> DiG 9.7.3 <<>> ltx1
    ;; global options: +cmd
    ;; Got answer:
    ;; ->>HEADER<<- opcode: QUERY, status: NXDOMAIN, id: 14204
    ;; flags: qr rd ra; QUERY: 1, ANSWER: 0, AUTHORITY: 0, ADDITIONAL: 0

    ;; QUESTION SECTION:
    ;ltx1. IN A

    ;; Query time: 4 msec
    ;; SERVER: 172.16.122.5#53(172.16.122.5)
    ;; WHEN: Mon Dec 10 17:05:30 2012
    ;; MSG SIZE rcvd: 22

    *********** here are the relevant config files: **************

    [email protected]:/etc/bind# cat named.conf.options
    options {

    directory "/var/cache/bind";

    forwarders { 10.5.101.254; };

    allow-query { any; };

    listen-on-v6 { any; };

    auth-nxdomain no; # conform to RFC1035
    };

    [email protected]:/etc/bind# cat named.conf.local
    //
    // Do any local configuration here
    //
    key DHCP_UPDATER {
    algorithm HMAC-MD5.SIG-ALG.REG.INT;
    secret pRP5FapFoJ95JEL06sv4PQ==;
    };


    zone "hipower.service.fiberio.local" {
    type master;
    file "fiberio.db";
    notify yes;
    allow-update { key DHCP_UPDATER; };
    };

    zone "122.16.172.in-addr.arpa" {
    type master;
    file "172.rev";
    notify yes;
    allow-update { key DHCP_UPDATER; };
    };


    // Consider adding the 1918 zones here, if they are not used in your
    organization
    include "/etc/bind/zones.rfc1918";

    [email protected]:/etc/bind# cat /var/cache/bind/fiberio.db
    $ORIGIN .
    $TTL 604800 ; 1 week
    hipower.service.fiberio.local IN SOA
    dns.hipower.service.fiberio.local. root.hipower.service.fiberio.local. (
    2012120901 ; serial
    604800 ; refresh (1 week)
    86400 ; retry (1 day)
    2419200 ; expire (4 weeks)
    604800 ; minimum (1 week)
    )
    NS dns.hipower.service.fiberio.local.
    $ORIGIN hipower.service.fiberio.local.
    dns A 172.16.122.5
    $TTL 300 ; 5 minutes
    FIBERIO-BILL A 172.16.122.210
    TXT "31f054ee9028efb35670c1501abb244fc1"
    LTX1 A 172.16.122.211
    TXT "3176f703664baea97288ee8b03d253b3bc"

    [email protected]:/etc/bind# cat /var/cache/bind/172.rev
    $ORIGIN .
    $TTL 604800 ; 1 week
    122.16.172.in-addr.arpa IN SOA dns.hipower.service.fiberio.local.
    root.hipower.service.fiberio.local. (
    2012120902 ; serial
    604800 ; refresh (1 week)
    86400 ; retry (1 day)
    2419200 ; expire (4 weeks)
    604800 ; minimum (1 week)
    )
    NS dns.hipower.service.fiberio.local.
    $ORIGIN 122.16.172.in-addr.arpa.
    $TTL 300 ; 5 minutes
    210 PTR FIBERIO-BILL.fiberio.local.
    211 PTR LTX1.hipower.service.fiberio.local.

    [email protected]:/etc/bind# cat /etc/hosts
    127.0.0.1 localhost.localdomain localhost
    172.16.122.5 sam.hipower.service.fiberio.local sam
    172.16.122.5 dns.hipower.service.fiberio.local dns
    172.16.122.20 plc1.hipower.service.fiberio.local plc1
    172.16.122.201 spin1.hipower.service.fiberio.local spin1

    [email protected]:/etc/bind# cat /etc/resolv.conf
    domain hipower.service.fiberio.local
    gateway 172.16.122.254
    nameserver 172.16.122.5
    nameserver 127.0.0.1

    [email protected]:/etc/bind# cat /etc/nsswitch.conf
    # /etc/nsswitch.conf
    #
    # Example configuration of GNU Name Service Switch functionality.
    # If you have the `glibc-doc-reference' and `info' packages installed, try:
    # `info libc "Name Service Switch"' for information about this file.

    passwd: compat
    group: compat
    shadow: compat

    hosts: files dns
    networks: files

    protocols: db files
    services: db files
    ethers: db files
    rpc: db files

    netgroup: nis
     
    Bill McCormick, Dec 10, 2012
    #1
    1. Advertisements

  2. Hello,

    Bill McCormick a écrit :
    BIND does only DNS and does not care about /etc/hosts. This file is used
    by the local resolver library. It is not DNS.
    Well, it looks like host appends the domain from the "domain" or
    "search" options in /etc/resolv.conf before sending the query when the
    name does not look like an FQDN whereas dig does not. Again, this has
    nothing to do with BIND itself.

    I do not see any BIND issue here.
     
    Pascal Hambourg, Dec 11, 2012
    #2
    1. Advertisements

  3. AFAIK pdnsd can serve the /etc/hosts contents to others, but pdnsd is
    mostly for caching dns lookups and might not be enough for complex stuff..

    source {
    owner=x.y.z;
    serve_aliases=on;
    file="/etc/hosts";
    }
     
    Johann Klammer, Dec 11, 2012
    #3
  4. Bill McCormick

    Grant Guest

    Perhaps OP could look at dnsmasq (caching nameserver)? Not BIND by any
    means, but it refers to /etc/hosts before forwarding a query out to Internet.

    Grant.
     
    Grant, Dec 11, 2012
    #4
  5. Got dnsmasq up and running. I like it. Lightweight; dhcp built in; reads
    files of host=ip; exactly what I need.
     
    Bill McCormick, Dec 11, 2012
    #5
    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.