I'm pretty sure I'm doing something stupid, but let's ask anyway.

I'm trying to create "hostnames" on my LAN machines (eg. when you ping "chris", Chris' machine - IP - respond to that). I'm doing this through a Debian (lenny) server with bind9, and using this server as the LAN's primary DNS server.

Problem: I can ping whatever.chris from other machines, but not chris. What am I doing wrong?

I followed these instructions to setup bind9: http://www.cahilig.net/2008/07/05/how-setup-lan-dns-server-using-bind9-under-debian-etch-and-ubuntu-804




/etc/hosts localhost chris.chris chris

# The following lines are desirable for IPv6 capable hosts
::1 localhost ip6-localhost ip6-loopback
fe00::0 ip6-localnet
ff00::0 ip6-mcastprefix
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters
ff02::3 ip6-allhosts


Didn't touch this one, as resolvconf overwrites it


zone "chris" {
        type master;
        file "db.chris";

zone "1.168.192.in-addr.arpa" {
        type master;
        file "db.192.168.1";


$TTL 604800
@ IN SOA main.chris. admin.chris. (
                2012051610      ;serial
                04800           ;refresh
                86400           ;retry
                60              ;expire
                604800          ;negative cache TTL
@      IN      NS       main.chris.
@      IN      A
www    IN      A
main   IN      A


$TTL 604800
@ IN SOA main.chris. admin.chris. (
                2012051606      ;serial
                604800          ;refresh
                86400           ;retry
                60              ;expire
                604800          ;negative cache TTL
@       IN      NS      main.chris.
1       IN      PTR     chris.


options {
        directory "/var/cache/bind";

        forwarders {

        auth-nxdomain no;    # conform to RFC1035
        listen-on-v6 { any; };

I'd recommend you put all these in one zone, lets call it "local", then add hosts to local like chris.local, john.local. Then you want each of these machines to end up with search local in their /etc/resolv.conf, This will make it so that when they ping chris it automatically will try to find an ip address for chris.local if chris isn't found.

Typically you would have your dhcp server send them this search directive, but it can also be configured using resolvconf

  • I changed that on /etc/network/interfaces, adding dns-nameservers and dns-search chris to it and restarting /etc/init.d/networking, but it didn't work. :( – dmmd May 16 '12 at 0:39

Ensure that the permissions on your zone file is correct. I believe it needs to be chmod 644, or was it 744. Once you have made the changes did you do: "/etc/init.d/named restart" Also, for any hints on additional issues check your /var/log/messages for any pointers.

Your zone file should look like this.


  • I tried that but no luck. I'm still able to ping 'whatever.chris', but not 'chris' itself. Also, the log didn't give me anything useful. – dmmd May 16 '12 at 0:33

If you want to do dns lookups by shortname (i.e. not just by fully-qualified domain names), then you are in the realm of /etc/resolv.conf and the 'search' parameter.

search chris

man 5 resolv.conf for details

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.