I want to configure bind (v9) on Slackware (v14.2) so that example.com resolves to the IP address of the local Apache server.

This is my /etc/resolv.conf:

# Generated by dhcpcd from eth0.dhcp
# /etc/resolv.conf.head can replace this line
# /etc/resolv.conf.tail can replace this line


options {
    directory "/var/named";
     * If there is a firewall between you and nameservers you want
     * to talk to, you might need to uncomment the query-source
     * directive below.  Previous versions of BIND always asked
     * questions using port 53, but BIND 8.1 uses an unprivileged
     * port by default.
    // query-source address * port 53;

// a caching only nameserver config
zone "." IN {
    type hint;
    file "caching-example/named.root";

zone "localhost" IN {
    type master;
    file "caching-example/localhost.zone";
    allow-update { none; };

zone "0.0.127.in-addr.arpa" IN {
    type master;
    file "caching-example/named.local";
    allow-update { none; };

zone "example.com"{
    type master;
    file "/var/named/example.com.hosts";
    notify yes;


$TTL 3600
example.com. IN      SOA     sb.slackintosh.com. hostmaster.slackintosh.com. (
7200 )

       IN      A
       IN      NS sb.slaskintosh.com.
       IN      MX 5 mail.example.com.

mail         IN      A
www          IN      A

Still, after restarting bind, example.com doesn't resolve:

bash-4.3# nslookup example.com


** server can`t find example.com: NXDOMAIN 

What did I do wrong? Thank you in advance!

EDIT: I ran named-checkzone and this is the output:

bash-4.3# named-checkzone localhost /var/named/itlink.edu.hosts 
/var/named/itlink.edu.hosts:5: ignoring out-of-zone data (itlink.edu)
zone localhost/IN: has 0 SOA records
zone localhost/IN: has no NS records
zone localhost/IN: not loaded due to errors.
  • Just as an FYI, substituting for directory and IP, your host file and .conf entry loaded fine for me locally... so the format doesn't seem to be the issue. – Anaksunaman Aug 7 '17 at 5:58
  • What does nslookup www.example.com give? or ` nslookup mail.example.com`? – Ljm Dullaart Jan 28 '18 at 16:10

Your Answer

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

Browse other questions tagged or ask your own question.