Bind configuration for a fake domain in the local network Only .

Hi
I m trying to configure a local domain in Opensuse.
So I installed Bind and define the forward Zone and reverse but I am not get the result that i expected.

I create the files like this …

/var/lib/named/var/lib/named/master/web.lan.forward.


$TTL 1H
@        IN SOA    srv.web.lan.   root.web.lan. (
                46        ; serial (d. adams)
                2D        ; refresh
                4H        ; retry
                6W        ; expiry
                1W )        ; minimum

                IN    NS        web.lan.
                IN     A        127.0.0.1
                           IN     AAAA              ::1

; A records
srv            A    192.168.1.9


MckB            IN    A    10.8.0.62
w7station                IN    A    10.8.0.5
TL-WR841N            IN    A    192.168.1.100


; CNAMES ALIASES
tplink-lab    IN    CNAME    TL-WR841N.web.lan.


web.lan.reverse


$TTL 1H
@        IN SOA        srv.web.lan.   root.web.lan. (
                46        ; serial (d. adams)
                1D        ; refresh
                4H        ; retry
                1W        ; expiry
                1W )        ; minimum

@        IN NS        srv.web.lan.


5        IN PTR        w7station.web.lan.

62        IN PTR        MckB.web.lan.        

100        IN PTR        TL-WR841N.web.lan.


After i create this 2 files on /var/lib/named/var/lib/named/master/

i update the file /etc/named.conf



##Local Area network Zone 

zone "lan.forward" in {
        type master;
        file "/var/lib/named/master/web.lan.forward";
};


zone "1.168.192.in-addr.arpa" in {
        type master;
        notify no;
        file "/var/lib/named/master/web.lan.reverse";
};


after i restart the service and everything okay…

But if i do nslookup to some of my IP like 192.168.1.9 or 10.8.0.1

i get always

Server: 127.0.0.1
Address: 127.0.0.1#53

** server can’t find 1.0.8.10.in-addr.arpa.: NXDOMAIN

anyone expert on bin here ?

Tank s

there is good documentation how to configure very easy dns server with YaST - https://activedoc.opensuse.org/book/opensuse-reference/chapter-15-the-domain-name-system

To begin with, can you please use CODE tags (the # button in the tool bar) and not PHP. It is no PHP and the coulouring, etc. distracts from the subject. Also, why not showing your complete nslookup within CODE tags, now it is uncertain if it is story telling or computer facts. Same btw for those file listings. Better show the prompt, the cat command, the output and the next prompt in one copy/paste sweep from the terminal into the post. Then we can see what you did, what you got, who you were and where you were witthout the need for you to explain all that.
Then to your subject. It is a long time ago I managed a DNS server. But while I see the PRT RR like:

5        IN PTR        w7station.web.lan.

I can’t find that this is the last element of 10.0.8 network. Or am I wrong here?

 okay.. Lets start with named.conf  yugi@srv:~> cat /etc/named.conf  
 # Copyright (c) 2001-2004 SuSE Linux AG, Nuernberg, Germany. # All rights reserved. # # Author: Frank Bodammer, Lars Mueller  # # /etc/named.conf # # This is a sample configuration file for the name server BIND 9.  It works as # a caching only name server without modification. # # A sample configuration for setting up your own domain can be found in # /usr/share/doc/packages/bind/sample-config. # # A description of all available options can be found in # /usr/share/doc/packages/bind/misc/options.  options {      # The directory statement defines the name server's working directory      directory "/var/lib/named";      # Write dump and statistics file to the log subdirectory.  The     # pathenames are relative to the chroot jail.      dump-file "/var/log/named_dump.db";     statistics-file "/var/log/named.stats";      # Enable the next entry to prefer usage of the name server declared in     # the forwarders section.      #forward first;      # The listen-on record contains a list of local network interfaces to     # listen on.  Optionally the port can be specified.  Default is to     # listen on all interfaces found on your system.  The default port is     # 53.      #listen-on port 53 { 127.0.0.1; };      # The listen-on-v6 record enables or disables listening on IPv6     # interfaces.  Allowed values are 'any' and 'none' or a list of     # addresses.      listen-on-v6 { any; };      # The next three statements may be needed if a firewall stands between     # the local server and the internet.      #query-source address * port 53;     #transfer-source * port 53;     #notify-source * port 53;      # The allow-query record contains a list of networks or IP addresses     # to accept and deny queries from. The default is to allow queries     # from all hosts.      #allow-query { 127.0.0.1; };      # If notify is set to yes (default), notify messages are sent to other     # name servers when the the zone data is changed.  Instead of setting     # a global 'notify' statement in the 'options' section, a separate     # 'notify' can be added to each zone definition.      notify no;      disable-empty-zone "1.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.IP6.ARPA";     include "/etc/named.d/forwarders.conf"; };  # To configure named's logging remove the leading '#' characters of the # following examples. #logging { #    # Log queries to a file limited to a size of 100 MB. #    channel query_logging { #        file "/var/log/named_querylog" #            versions 3 size 100M; #        print-time yes;            // timestamp log entries #    }; #    category queries { #        query_logging; #    }; # #    # Or log this kind alternatively to syslog. #    channel syslog_queries { #        syslog user; #        severity info; #    }; #    category queries { syslog_queries; }; # #    # Log general name server errors to syslog. #    channel syslog_errors { #        syslog user; #        severity error; #    }; #    category default { syslog_errors;  }; # #    # Don't log lame server messages. #    category lame-servers { null; }; #};  # The following zone definitions don't need any modification.  The first one # is the definition of the root name servers.  The second one defines # localhost while the third defines the reverse lookup for localhost.  zone "." in {     type hint;     file "root.hint"; };  zone "localhost" in {     type master;     file "localhost.zone"; };  zone "0.0.127.in-addr.arpa" in {     type master;     file "127.0.0.zone"; };  zone "0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.ip6.arpa" in {     type master;     file "127.0.0.zone"; };  ##Local Area network Zone  zone “lan.forward” in {     type master;     file "/var/lib/named/master/web.lan.forward"; };   zone “1.168.192.in-addr.arpa" in {     type master;     notify no;     file "/var/lib/named/master/web.lan.reverse"; };      # Include the meta include file generated by createNamedConfInclude.  This # includes all files as configured in NAMED_CONF_INCLUDE_FILES from # /etc/sysconfig/named  include "/etc/named.conf.include";  # You can insert further zone records for your own domains below or create # single files in /etc/named.d/ and add the file names to # NAMED_CONF_INCLUDE_FILES. # See /usr/share/doc/packages/bind/README.SUSE for more details.   
 yugi@srv:~>   yugi@srv:~> cat /var/lib/named/master/web.lan.forward    

$TTL 1H @ IN SOA srv.web.lan. root.web.lan. ( 46 ; serial (d. adams) 2D ; refresh 4H ; retry 6W ; expiry 1W ) ; minimum IN NS web.lan. IN A 127.0.0.1 IN AAAA ::1 ; A records srv A 192.168.1.9 MckB IN A 10.8.0.62 w7station IN A 10.8.0.5 TL-WR841N IN A 192.168.1.100 ; CNAMES ALIASES tplink-lab IN CNAME TL-WR841N.web.lan.

   yugi@srv:~>   yugi@srv:~> cat /var/lib/named/master/web.lan.reverse   

$TTL 1H @ IN SOA srv.web.lan. root.web.lan. ( 46 ; serial (d. adams) 1D ; refresh 4H ; retry 1W ; expiry 1W ) ; minimum @ IN NS srv.web.lan. 5 IN PTR w7station.web.lan. 62 IN PTR MckB.web.lan. 100 IN PTR TL-WR841N.web.lan.

  My NICs State :   

yugi@srv:~> sudo su bash-4.1# ifconfig br0 Link encap:Ethernet HWaddr C6:43:C1:F3:C2:09 inet addr:192.168.0.100 Bcast:192.168.0.255 Mask:255.255.255.0 inet6 addr: fe80::c443:c1ff:fef3:c209/64 Scope:Link UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 RX packets:0 errors:0 dropped:0 overruns:0 frame:0 TX packets:9 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:0 RX bytes:0 (0.0 b) TX bytes:744 (744.0 b) dsl0 Link encap:Point-to-Point Protocol inet addr:2.89.294.185 P-t-P:194.69.169.132 Mask:255.255.255.255 UP POINTOPOINT RUNNING NOARP MULTICAST MTU:1492 Metric:1 RX packets:256745 errors:0 dropped:0 overruns:0 frame:0 TX packets:313162 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:3 RX bytes:110652789 (105.5 Mb) TX bytes:121492356 (115.8 Mb) eth0 Link encap:Ethernet HWaddr 00:19:B9:62:BB:A4 inet addr:192.168.1.9 Bcast:192.168.1.255 Mask:255.255.255.0 inet6 addr: fe80::219:b9ff:fe62:bba4/64 Scope:Link UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 RX packets:182872 errors:0 dropped:0 overruns:0 frame:0 TX packets:195829 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:104447129 (99.6 Mb) TX bytes:105722093 (100.8 Mb) Interrupt:17 eth2 Link encap:Ethernet HWaddr 00:60:6E:42:43:DF inet addr:10.0.0.10 Bcast:10.0.0.255 Mask:255.255.255.0 inet6 addr: fe80::260:6eff:fe42:43df/64 Scope:Link UP BROADCAST RUNNING MULTICAST MTU:1492 Metric:1 RX packets:257179 errors:0 dropped:0 overruns:0 frame:0 TX packets:313608 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:112729640 (107.5 Mb) TX bytes:129650658 (123.6 Mb) lo Link encap:Local Loopback inet addr:127.0.0.1 Mask:255.0.0.0 inet6 addr: ::1/128 Scope:Host UP LOOPBACK RUNNING MTU:16436 Metric:1 RX packets:24183 errors:0 dropped:0 overruns:0 frame:0 TX packets:24183 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:0 RX bytes:2677796 (2.5 Mb) TX bytes:2677796 (2.5 Mb) tun0 Link encap:UNSPEC HWaddr 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00 inet addr:10.8.0.1 P-t-P:10.8.0.2 Mask:255.255.255.255 UP POINTOPOINT RUNNING NOARP MULTICAST MTU:1500 Metric:1 RX packets:32604 errors:0 dropped:0 overruns:0 frame:0 TX packets:31916 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:100 RX bytes:3682984 (3.5 Mb) TX bytes:2338786 (2.2 Mb) bash-4.1#

    Now if i make one nslookup on the machine at his IP  I get this :   

bash-4.1# bash-4.1# bash-4.1# bash-4.1# bash-4.1# nslookup 10.8.0.1 Server: 127.0.0.1 Address: 127.0.0.1#53 ** server can’t find 1.0.8.10.in-addr.arpa.: NXDOMAIN bash-4.1# nslookup 192.168.1.9 Server: 127.0.0.1 Address: 127.0.0.1#53 ** server can’t find 9.1.168.192.in-addr.arpa.: NXDOMAIN bash-4.1# nslookup srv Server: 127.0.0.1 Address: 127.0.0.1#53 ** server can’t find src: NXDOMAIN bash-4.1#

  But if I make like this i Get :  

bash-4.1# nslookup srv.web.lan Server: 127.0.0.1 Address: 127.0.0.1#53 Name: srv.web.lan Address: 192.168.1.9 bash-4.1#

okay… Lets start with named.conf yugi@srv:~> cat /etc/named.conf

 # Copyright (c) 2001-2004 SuSE Linux AG, Nuernberg, Germany. # All rights reserved. # # Author: Frank Bodammer, Lars Mueller  # # /etc/named.conf # # This is a sample configuration file for the name server BIND 9.  It works as # a caching only name server without modification. # # A sample configuration for setting up your own domain can be found in # /usr/share/doc/packages/bind/sample-config. # # A description of all available options can be found in # /usr/share/doc/packages/bind/misc/options.  options {      # The directory statement defines the name server's working directory      directory "/var/lib/named";      # Write dump and statistics file to the log subdirectory.  The     # pathenames are relative to the chroot jail.      dump-file "/var/log/named_dump.db";     statistics-file "/var/log/named.stats";      # Enable the next entry to prefer usage of the name server declared in     # the forwarders section.      #forward first;      # The listen-on record contains a list of local network interfaces to     # listen on.  Optionally the port can be specified.  Default is to     # listen on all interfaces found on your system.  The default port is     # 53.      #listen-on port 53 { 127.0.0.1; };      # The listen-on-v6 record enables or disables listening on IPv6     # interfaces.  Allowed values are 'any' and 'none' or a list of     # addresses.      listen-on-v6 { any; };      # The next three statements may be needed if a firewall stands between     # the local server and the internet.      #query-source address * port 53;     #transfer-source * port 53;     #notify-source * port 53;      # The allow-query record contains a list of networks or IP addresses     # to accept and deny queries from. The default is to allow queries     # from all hosts.      #allow-query { 127.0.0.1; };      # If notify is set to yes (default), notify messages are sent to other     # name servers when the the zone data is changed.  Instead of setting     # a global 'notify' statement in the 'options' section, a separate     # 'notify' can be added to each zone definition.      notify no;      disable-empty-zone "1.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.IP6.ARPA";     include "/etc/named.d/forwarders.conf"; };  # To configure named's logging remove the leading '#' characters of the # following examples. #logging { #    # Log queries to a file limited to a size of 100 MB. #    channel query_logging { #        file "/var/log/named_querylog" #            versions 3 size 100M; #        print-time yes;            // timestamp log entries #    }; #    category queries { #        query_logging; #    }; # #    # Or log this kind alternatively to syslog. #    channel syslog_queries { #        syslog user; #        severity info; #    }; #    category queries { syslog_queries; }; # #    # Log general name server errors to syslog. #    channel syslog_errors { #        syslog user; #        severity error; #    }; #    category default { syslog_errors;  }; # #    # Don't log lame server messages. #    category lame-servers { null; }; #};  # The following zone definitions don't need any modification.  The first one # is the definition of the root name servers.  The second one defines # localhost while the third defines the reverse lookup for localhost.  zone "." in {     type hint;     file "root.hint"; };  zone "localhost" in {     type master;     file "localhost.zone"; };  zone "0.0.127.in-addr.arpa" in {     type master;     file "127.0.0.zone"; };  zone "0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.ip6.arpa" in {     type master;     file "127.0.0.zone"; };  ##Local Area network Zone  zone “lan.forward” in {     type master;     file "/var/lib/named/master/web.lan.forward"; };   zone “1.168.192.in-addr.arpa" in {     type master;     notify no;     file "/var/lib/named/master/web.lan.reverse"; };      # Include the meta include file generated by createNamedConfInclude.  This # includes all files as configured in NAMED_CONF_INCLUDE_FILES from # /etc/sysconfig/named  include "/etc/named.conf.include";  # You can insert further zone records for your own domains below or create # single files in /etc/named.d/ and add the file names to # NAMED_CONF_INCLUDE_FILES. # See /usr/share/doc/packages/bind/README.SUSE for more details.   

yugi@srv:~> yugi@srv:~> cat /var/lib/named/master/web.lan.forward

  $TTL 1H @        IN SOA    srv.web.lan.   root.web.lan. (                 46        ; serial (d. adams)                 2D        ; refresh                 4H        ; retry                 6W        ; expiry                 1W )        ; minimum                  IN     NS       web.lan.                 IN     A        127.0.0.1                 IN     AAAA     ::1  ; A records srv                        A    192.168.1.9 MckB                 IN    A    10.8.0.62 w7station            IN    A    10.8.0.5 TL-WR841N            IN    A    192.168.1.100   ; CNAMES ALIASES tplink-lab    IN    CNAME    TL-WR841N.web.lan.    

yugi@srv:~> yugi@srv:~> cat /var/lib/named/master/web.lan.reverse

  $TTL 1H @        IN SOA        srv.web.lan.   root.web.lan. (                 46        ; serial (d. adams)                 1D        ; refresh                 4H        ; retry                 1W        ; expiry                 1W )      ; minimum  @         IN NS         srv.web.lan. 5         IN PTR        w7station.web.lan. 62        IN PTR        MckB.web.lan.         100       IN PTR        TL-WR841N.web.lan.    

My NICs State :

  yugi@srv:~> sudo su bash-4.1# ifconfig   br0       Link encap:Ethernet  HWaddr C6:43:C1:F3:C2:09             inet addr:192.168.0.100  Bcast:192.168.0.255  Mask:255.255.255.0           inet6 addr: fe80::c443:c1ff:fef3:c209/64 Scope:Link           UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1           RX packets:0 errors:0 dropped:0 overruns:0 frame:0           TX packets:9 errors:0 dropped:0 overruns:0 carrier:0           collisions:0 txqueuelen:0            RX bytes:0 (0.0 b)  TX bytes:744 (744.0 b)  dsl0      Link encap:Point-to-Point Protocol             inet addr:2.89.294.185  P-t-P:194.69.169.132  Mask:255.255.255.255           UP POINTOPOINT RUNNING NOARP MULTICAST  MTU:1492  Metric:1           RX packets:256745 errors:0 dropped:0 overruns:0 frame:0           TX packets:313162 errors:0 dropped:0 overruns:0 carrier:0           collisions:0 txqueuelen:3            RX bytes:110652789 (105.5 Mb)  TX bytes:121492356 (115.8 Mb)  eth0      Link encap:Ethernet  HWaddr 00:19:B9:62:BB:A4             inet addr:192.168.1.9  Bcast:192.168.1.255  Mask:255.255.255.0           inet6 addr: fe80::219:b9ff:fe62:bba4/64 Scope:Link           UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1           RX packets:182872 errors:0 dropped:0 overruns:0 frame:0           TX packets:195829 errors:0 dropped:0 overruns:0 carrier:0           collisions:0 txqueuelen:1000            RX bytes:104447129 (99.6 Mb)  TX bytes:105722093 (100.8 Mb)           Interrupt:17   eth2      Link encap:Ethernet  HWaddr 00:60:6E:42:43:DF             inet addr:10.0.0.10  Bcast:10.0.0.255  Mask:255.255.255.0           inet6 addr: fe80::260:6eff:fe42:43df/64 Scope:Link           UP BROADCAST RUNNING MULTICAST  MTU:1492  Metric:1           RX packets:257179 errors:0 dropped:0 overruns:0 frame:0           TX packets:313608 errors:0 dropped:0 overruns:0 carrier:0           collisions:0 txqueuelen:1000            RX bytes:112729640 (107.5 Mb)  TX bytes:129650658 (123.6 Mb)  lo        Link encap:Local Loopback             inet addr:127.0.0.1  Mask:255.0.0.0           inet6 addr: ::1/128 Scope:Host           UP LOOPBACK RUNNING  MTU:16436  Metric:1           RX packets:24183 errors:0 dropped:0 overruns:0 frame:0           TX packets:24183 errors:0 dropped:0 overruns:0 carrier:0           collisions:0 txqueuelen:0            RX bytes:2677796 (2.5 Mb)  TX bytes:2677796 (2.5 Mb)  tun0      Link encap:UNSPEC  HWaddr 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00             inet addr:10.8.0.1  P-t-P:10.8.0.2  Mask:255.255.255.255           UP POINTOPOINT RUNNING NOARP MULTICAST  MTU:1500  Metric:1           RX packets:32604 errors:0 dropped:0 overruns:0 frame:0           TX packets:31916 errors:0 dropped:0 overruns:0 carrier:0           collisions:0 txqueuelen:100            RX bytes:3682984 (3.5 Mb)  TX bytes:2338786 (2.2 Mb)  bash-4.1#  
Now if i make one nslookup on the machine at his IP  I get this :   
 bash-4.1#  bash-4.1#  bash-4.1#  bash-4.1#  bash-4.1# nslookup 10.8.0.1 Server:		127.0.0.1 Address:	127.0.0.1#53  ** server can't find 1.0.8.10.in-addr.arpa.: NXDOMAIN  bash-4.1# nslookup 192.168.1.9 Server:		127.0.0.1 Address:	127.0.0.1#53  ** server can't find 9.1.168.192.in-addr.arpa.: NXDOMAIN  bash-4.1# nslookup srv Server:		127.0.0.1 Address:	127.0.0.1#53  ** server can't find src: NXDOMAIN  bash-4.1#  

But if I make like this i Get :

 bash-4.1# nslookup srv.web.lan Server:		127.0.0.1 Address:	127.0.0.1#53  Name:	srv.web.lan Address: 192.168.1.9  bash-4.1#   

You need to focus on exactly which domain and its reverse lookup zones to post about (192.168.a.b vs 10.x.y.z)
By posting zone definitions for 192.168.a.b and then asking why a reverse lookup for 10.x.y.z doesn’t work, no one can identify what your problem is.

At least, unless that really is your problem…

TSU

okay
let s see if i can explain …


# Copyright (c) 2001-2004 SuSE Linux AG, Nuernberg, Germany.
# All rights reserved.
#
# Author: Frank Bodammer, Lars Mueller <lmuelle@suse.de>
#
# /etc/named.conf
#
# This is a sample configuration file for the name server BIND 9.  It works as
# a caching only name server without modification.
#
# A sample configuration for setting up your own domain can be found in
# /usr/share/doc/packages/bind/sample-config.
#
# A description of all available options can be found in
# /usr/share/doc/packages/bind/misc/options.

options {

    # The directory statement defines the name server's working directory

    directory "/var/lib/named";

    # Write dump and statistics file to the log subdirectory.  The
    # pathenames are relative to the chroot jail.

    dump-file "/var/log/named_dump.db";
    statistics-file "/var/log/named.stats";

    # Enable the next entry to prefer usage of the name server declared in
    # the forwarders section.

    #forward first;

    # The listen-on record contains a list of local network interfaces to
    # listen on.  Optionally the port can be specified.  Default is to
    # listen on all interfaces found on your system.  The default port is
    # 53.

    listen-on port 53 { 127.0.0.1;10.8.0.1;192.168.1.9; };

    # The listen-on-v6 record enables or disables listening on IPv6
    # interfaces.  Allowed values are 'any' and 'none' or a list of
    # addresses.

    listen-on-v6 { any; };

    # The next three statements may be needed if a firewall stands between
    # the local server and the internet.

    #query-source address * port 53;
    #transfer-source * port 53;
    #notify-source * port 53;

    # The allow-query record contains a list of networks or IP addresses
    # to accept and deny queries from. The default is to allow queries
    # from all hosts.

    allow-query { 127.0.0.1;192.168.1.0;10.8.0.0; };

    # If notify is set to yes (default), notify messages are sent to other
    # name servers when the the zone data is changed.  Instead of setting
    # a global 'notify' statement in the 'options' section, a separate
    # 'notify' can be added to each zone definition.

    notify no;

    disable-empty-zone "1.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.IP6.ARPA";
    include "/etc/named.d/forwarders.conf";
};

# To configure named's logging remove the leading '#' characters of the
# following examples.
#logging {
#    # Log queries to a file limited to a size of 100 MB.
#    channel query_logging {
#        file "/var/log/named_querylog"
#            versions 3 size 100M;
#        print-time yes;            // timestamp log entries
#    };
#    category queries {
#        query_logging;
#    };
#
#    # Or log this kind alternatively to syslog.
#    channel syslog_queries {
#        syslog user;
#        severity info;
#    };
#    category queries { syslog_queries; };
#
#    # Log general name server errors to syslog.
#    channel syslog_errors {
#        syslog user;
#        severity error;
#    };
#    category default { syslog_errors;  };
#
#    # Don't log lame server messages.
#    category lame-servers { null; };
#};

# The following zone definitions don't need any modification.  The first one
# is the definition of the root name servers.  The second one defines
# localhost while the third defines the reverse lookup for localhost.

zone "." in {
    type hint;
    file "root.hint";
};

zone "localhost" in {
    type master;
    file "localhost.zone";
};

zone "0.0.127.in-addr.arpa" in {
    type master;
    file "127.0.0.zone";
};

zone "0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.ip6.arpa" in {
    type master;
    file "127.0.0.zone";
};

##Local Area network Zone 

zone "srv.lan" in {
    type master;
    file "/var/lib/named/master/web.lan.forward";
};


zone "srv.lan.reverse" in {
    type master;
    notify no;
    file "/var/lib/named/master/web.lan.reverse";
};





# Include the meta include file generated by createNamedConfInclude.  This
# includes all files as configured in NAMED_CONF_INCLUDE_FILES from
# /etc/sysconfig/named

include "/etc/named.conf.include";

# You can insert further zone records for your own domains below or create
# single files in /etc/named.d/ and add the file names to
# NAMED_CONF_INCLUDE_FILES.
# See /usr/share/doc/packages/bind/README.SUSE for more details.


forward zone for 192.168.1.0



bash-4.1# cat /var/lib/named/master/web.lan.forward 


$TTL 1H
@        IN SOA    srv.web.lan.   root.web.lan. (
                46        ; serial (d. adams)
                2D        ; refresh
                4H        ; retry
                6W        ; expiry
                1W )        ; minimum

                IN    NS        srv.lan.
                IN     A        127.0.0.1
                           IN     AAAA              ::1

; A records
srv                    A    192.168.1.9


MckB                 IN    A    10.8.0.62
w7station            IN    A    10.8.0.5
TL-WR841N            IN    A    192.168.1.100


; CNAMES ALIASES

tplink-lab    IN    CNAME    TL-WR841N.web.lan.



reverse for network 192.168.1.0


bash-4.1# cat /var/lib/named/master/web.lan.reverse 
$TTL 1H
@        IN SOA        srv.web.lan.   root.web.lan. (
                46        ; serial (d. adams)
                1D        ; refresh
                4H        ; retry
                1W        ; expiry
                1W )        ; minimum

@        IN NS        srv.web.lan.


5        IN PTR        w7station.web.lan.

62        IN PTR        MckB.web.lan.        

100        IN PTR        TL-WR841N.web.lan.

bash-4.1# 




bash-4.1# rcnamed restart
Shutting down name server BIND                                                                               done
Starting name server BIND                                                                                    done
bash-4.1# 


My networks NICs



bash-4.1# ifconfig
br0       Link encap:Ethernet  HWaddr F2:31:30:E7:C6:E6  
          inet addr:192.168.0.100  Bcast:192.168.0.255  Mask:255.255.255.0
          inet6 addr: fe80::f031:30ff:fee7:c6e6/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:15 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0 
          RX bytes:0 (0.0 b)  TX bytes:1296 (1.2 Kb)

dsl0      Link encap:Point-to-Point Protocol  
          inet addr:82.155.29.80  P-t-P:194.65.169.232  Mask:255.255.255.255
          UP POINTOPOINT RUNNING NOARP MULTICAST  MTU:1492  Metric:1
          RX packets:9308 errors:0 dropped:0 overruns:0 frame:0
          TX packets:29805 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:3 
          RX bytes:1094362 (1.0 Mb)  TX bytes:4889333 (4.6 Mb)

eth0      Link encap:Ethernet  HWaddr 00:19:B9:62:BB:A4  
          inet addr:192.168.1.9  Bcast:192.168.1.255  Mask:255.255.255.0
          inet6 addr: fe80::219:b9ff:fe62:bba4/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:601 errors:0 dropped:0 overruns:0 frame:0
          TX packets:587 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:81597 (79.6 Kb)  TX bytes:72349 (70.6 Kb)
          Interrupt:17 

eth2      Link encap:Ethernet  HWaddr 00:60:6E:42:43:DF  
          inet addr:10.0.0.10  Bcast:10.0.0.255  Mask:255.255.255.0
          inet6 addr: fe80::260:6eff:fe42:43df/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1492  Metric:1
          RX packets:9343 errors:0 dropped:0 overruns:0 frame:0
          TX packets:29861 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:1170574 (1.1 Mb)  TX bytes:5667379 (5.4 Mb)

lo        Link encap:Local Loopback  
          inet addr:127.0.0.1  Mask:255.0.0.0
          inet6 addr: ::1/128 Scope:Host
          UP LOOPBACK RUNNING  MTU:16436  Metric:1
          RX packets:1597 errors:0 dropped:0 overruns:0 frame:0
          TX packets:1597 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0 
          RX bytes:178093 (173.9 Kb)  TX bytes:178093 (173.9 Kb)

tun0      Link encap:UNSPEC  HWaddr 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00  
          inet addr:10.8.0.1  P-t-P:10.8.0.2  Mask:255.255.255.255
          UP POINTOPOINT RUNNING NOARP MULTICAST  MTU:1500  Metric:1
          RX packets:2180 errors:0 dropped:0 overruns:0 frame:0
          TX packets:2039 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:100 
          RX bytes:228816 (223.4 Kb)  TX bytes:142512 (139.1 Kb)

bash-4.1# 


The problem :


bash-4.1# nslookup 192.168.1.9
Server:        127.0.0.1
Address:    127.0.0.1#53

** server can't find 9.1.168.192.in-addr.arpa.: NXDOMAIN

bash-4.1# 





bash-4.1# nslookup srv.web.lan
Server:        127.0.0.1
Address:    127.0.0.1#53

** server can't find srv.web.lan: NXDOMAIN

bash-4.1# 



Hi
I am aware of that …
The network that matter is 192.168.1.0

So, it appears that when you do an nslookup, it doesn’t seem to be reading your configured zones…

  • Verify that another DNS service is not running on your machine. It might be another DNS server, it might be a DNS alternative like dnsmasq.

Run the following to see if your DNS server service is even running, and whether there are any “relevant” journal entries reported

systemctl status named

BTW - You didn’t say how you’re restarting your DNS server, but the preferred systemd way is to use the following command

systemctl status|start|stop|restart named

In the above, it’s enough to simply type “named” because the name is unique enough and systemd will understand you mean “named.service”

You can also search for any services on your machine (running or not) with the text strings in the name “dns” “bind” and “named” as follows

systemctl -a | grep dns bind named

BTW - Instead of trying to configure your zones by hand(and the DNS service overall) you should seriously consider installing the YAST DNS configuration applet instead

zypper in yast2-dns-server

TSU

Hi

Okay, so dnsmasq was up and i stop it. Tank s !!



srv:~ # rcdnsmasq stop
Shutting name service masq caching server - Warning: dnsmasq not runn done


Restart the service i use rcnamed or /etc/init.d/named restart

now the state of the named :



srv:~ # rcnamed status
Checking for nameserver BIND 
version: 9.7.4-P1
CPUs found: 2
worker threads: 2
number of zones: 20
debug level: 0
xfers running: 0
xfers deferred: 0
soa queries in progress: 0
query logging is OFF
recursive clients: 0/0/1000
tcp clients: 0/100
server is up and running  


now the test


srv:~ # nslookup 127.0.0.1
Server:        127.0.0.1
Address:    127.0.0.1#53

1.0.0.127.in-addr.arpa    name = localhost.

srv:~ # 
srv:~ # nslookup 192.168.1.9
Server:        127.0.0.1
Address:    127.0.0.1#53

** server can't find 9.1.168.192.in-addr.arpa.: NXDOMAIN
srv:~ # 
srv:~ # nslookup 10.8.0.1
Server:        127.0.0.1
Address:    127.0.0.1#53

** server can't find 1.0.8.10.in-addr.arpa.: NXDOMAIN
srv:~ #

So the problem persist …

any more ideas ?

Tank s

for reverse lookup you have to have the pseudodomain in-addr.arpa. It is appended to the network part of the address in reverse notation. So 192.168 is resolved into 168.192.in-addr.arpa: openSUSE Documentation

hi
Sorry, but could you be more specific please…

PV wrote:

> On 2/8/2015 4:06 PM, mymind wrote:
>> srv:~ # nslookup 192.168.1.9
>> Server: 127.0.0.1
>> Address: 127.0.0.1#53
>>
>> ** server can’t find 9.1.168.192.in-addr.arpa.: NXDOMAIN
>
>
> Have you added 192.168.1.9 to the “1.168.192.in-addr.arpa” zone? I only
> saw
> 5,62,and 100 but no 9. You should also run
>


> named-checkconf
> named-checkzone <path/to/zone/file>
> 

> These check syntax only not semantics.
>

As far as I can see this post never made it from the NNTP side of the forum
to the web side. I apologize if you have received it twice.


P.V.
“We’re all in this together, I’m pulling for you” Red Green

hi
Mate i don t need to put the 9 . I think ?
Because is the local address of the server itself … even so i have try and the result is the same …

about the commands that you refer, yes i try 2:


srv:~ # named
named               named-checkzone     named-journalprint
named-checkconf     named-compilezone   
srv:~ # named
named               named-checkzone     named-journalprint
named-checkconf     named-compilezone   
srv:~ # named-checkconf /etc/named.conf
srv:~ # named-checkconf /etc/named.conf
srv:~ # named-checkconf
srv:~ # named-checkconf
srv:~ # named-checkzone web.lan /var/lib/named/master/web.lan.forward 
zone web.lan/IN: loaded serial 48
OK
srv:~ #
srv:~ # named-checkzone /var/lib/named/master/web.lan.reverse /var/lib/named/master/web.lan.reverse 
zone /var/lib/named/master/web.lan.reverse/IN: loaded serial 49
OK
srv:~ #

I believe the problem is another.
For example if I try to ping to the machine “SRV” which is the proper host I’m not succeeding.
I did not changed my hosts file because I am waiting for my DNS Server take care of it.


srv:~ # ping localhost
PING localhost (127.0.0.1) 56(84) bytes of data.
64 bytes from localhost (127.0.0.1): icmp_seq=1 ttl=64 time=0.053 ms
64 bytes from localhost (127.0.0.1): icmp_seq=2 ttl=64 time=0.072 ms
64 bytes from localhost (127.0.0.1): icmp_seq=3 ttl=64 time=0.072 ms
^C
--- localhost ping statistics ---
3 packets transmitted, 3 received, 0% packet loss, time 2000ms
rtt min/avg/max/mdev = 0.053/0.065/0.072/0.012 ms
srv:~ # ping srv
ping: unknown host srv
srv:~ # 


in your post https://forums.opensuse.org/showthread.php/504918-Bind-configuration-for-a-fake-domain-in-the-local-network-Only?p=2693332#post2693332 you’ve specified reverse zone file in named.conf

zone "srv.lan.reverse" in {
    type master;
    notify no;
    file "/var/lib/named/master/web.lan.reverse";
};

and in file itself you use @ which means domain name is extracted from named.conf, but you should use pseudodomain in-addr.arpa

you should.

Thank U.
Seems to have solved the problem of reverse zone.


srv:/var/lib/named/master # nslookup 192.168.1.9
Server:        127.0.0.1
Address:    127.0.0.1#53

9.1.168.192.in-addr.arpa    name = srv.web.lan.

srv:/var/lib/named/master # nslookup 10.8.0.1
Server:        127.0.0.1
Address:    127.0.0.1#53

1.0.8.10.in-addr.arpa    name = srv.web.lan.

srv:/var/lib/named/master #


Still I do not quite understand the question of the “@”.

Can you explain me better this question?
That is if I put the “@” in zone file I must necessarily use the 1.168.192.in-addr name?

When I’m filling the named.conf and defining one zone :

Should I use always the name like xxx.xxx.xxx…in-addr.arpa.zone ?

In witch time i can use different names?

Can you give me a full example for I understand better ?


srv:/var/lib/named/master # cat 1.168.192.in-addr.arpa.zone 
$TTL 2D

@            IN SOA  srv.web.lan.  hostmaster.srv.web.lan. (
                2015021016    ; serial
                1D        ; refresh
                2H        ; retry
                1W        ; expiry
                2D )        ; minimum

        IN NS        srv.web.lan.

9        IN PTR        srv.web.lan.
100        IN PTR        TL-WR841N.web.lan.

srv:/var/lib/named/master # 



zone "1.168.192.in-addr.arpa" in {
    type master;
    file "/var/lib/named/master/1.168.192.in-addr.arpa.zone";
};

zone "0.8.10.in-addr.arpa" in {
        type master;
        file "/var/lib/named/master/0.8.10.in-addr.arpa.zone" ;
};

Another question I have is regarding the forward zone.
Apparently my zone forward is not working well, because when i try to Ping the name of the server i get:


srv:/var/lib/named/master # ping srv
ping: unknown host srv
srv:/var/lib/named/master # ping srv.web.lan
ping: unknown host srv.web.lan
srv:/var/lib/named/master # ping tl-wr841.web.lan
ping: unknown host tl-wr841.web.lan
srv:/var/lib/named/master # 


My forward zone is now like this :




srv:/var/lib/named/master # cat 192.168.1.zone 
$TTL 2D
@            IN SOA  srv.web.lan.  root.web.lan. (
                2015021517    ; serial
                1D        ; refresh
                2H        ; retry
                1W        ; expiry
                2D )        ; minimum

        IN NS        srv
        IN MX        10 srv
        IN AAA        ::1

; A RECORDS
srv        IN A        192.168.1.9
srv        IN A        10.8.0.1
TL-WR841N    IN A        191.168.1.100

;CNAME ALIASES
www        IN CNAME    srv
ftp        IN CNAME    srv

srv:/var/lib/named/master # 


and my named.conf regarding that forward is like this :




##Local Area network Zone 

zone "192.168.1.0.ip4.arpa" in {
    type master;
    file "/var/lib/named/master/192.168.1.zone";
};


zone "1.168.192.in-addr.arpa" in {
    type master;
    file "/var/lib/named/master/1.168.192.im-addr.arpa.zone";
};

zone "0.8.10.in-addr.arpa" in {
        type master;
        file "/var/lib/named/master/0.8.10.in-addr.arpa.zone" ;
};


And here you have my log from var log messages when i start the service


Feb 12 16:43:57 srv named[14029]: adjusted limit on open files from 8192 to 1048576
Feb 12 16:43:57 srv named[14029]: found 2 CPUs, using 2 worker threads
Feb 12 16:43:57 srv named[14029]: using up to 4096 sockets
Feb 12 16:43:57 srv named[14029]: Using 101 tasks for zone loading
Feb 12 16:43:57 srv named[14029]: loading configuration from '/etc/named.conf'
Feb 12 16:43:57 srv named[14029]: using default UDP/IPv4 port range: [1024, 65535]
Feb 12 16:43:57 srv named[14029]: using default UDP/IPv6 port range: [1024, 65535]
Feb 12 16:43:57 srv named[14029]: listening on IPv6 interfaces, port 53
Feb 12 16:43:57 srv named[14029]: listening on IPv4 interface lo, 127.0.0.1#53
Feb 12 16:43:57 srv named[14029]: listening on IPv4 interface eth0, 192.168.1.9#53
Feb 12 16:43:57 srv named[14029]: listening on IPv4 interface tun0, 10.8.0.1#53
Feb 12 16:43:57 srv named[14029]: generating session key for dynamic DNS
Feb 12 16:43:57 srv named[14029]: set up managed keys zone for view _default, file 'managed-keys.bind'
Feb 12 16:43:57 srv named[14029]: automatic empty zone: 0.IN-ADDR.ARPA
Feb 12 16:43:57 srv named[14029]: automatic empty zone: 127.IN-ADDR.ARPA
Feb 12 16:43:57 srv named[14029]: automatic empty zone: 254.169.IN-ADDR.ARPA
Feb 12 16:43:57 srv named[14029]: automatic empty zone: 2.0.192.IN-ADDR.ARPA
Feb 12 16:43:57 srv named[14029]: automatic empty zone: 100.51.198.IN-ADDR.ARPA
Feb 12 16:43:57 srv named[14029]: automatic empty zone: 113.0.203.IN-ADDR.ARPA
Feb 12 16:43:57 srv named[14029]: automatic empty zone: 255.255.255.255.IN-ADDR.ARPA
Feb 12 16:43:57 srv named[14029]: automatic empty zone: 0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.IP6.ARPA
Feb 12 16:43:57 srv named[14029]: automatic empty zone: D.F.IP6.ARPA
Feb 12 16:43:57 srv named[14029]: automatic empty zone: 8.E.F.IP6.ARPA
Feb 12 16:43:57 srv named[14029]: automatic empty zone: 9.E.F.IP6.ARPA
Feb 12 16:43:57 srv named[14029]: automatic empty zone: A.E.F.IP6.ARPA
Feb 12 16:43:57 srv named[14029]: automatic empty zone: B.E.F.IP6.ARPA
Feb 12 16:43:57 srv named[14029]: automatic empty zone: 8.B.D.0.1.0.0.2.IP6.ARPA
Feb 12 16:43:57 srv named[14029]: command channel listening on 127.0.0.1#953
Feb 12 16:43:57 srv named[14029]: command channel listening on ::1#953
Feb 12 16:43:57 srv named[14029]: the working directory is not writable
Feb 12 16:43:57 srv named[14029]: zone 192.168.1.0.ip4.arpa/IN: loading from master file /var/lib/named/master/192.168.1.zone failed: unknown class/type
Feb 12 16:43:57 srv named[14029]: zone 192.168.1.0.ip4.arpa/IN: not loaded due to errors.
Feb 12 16:43:57 srv named[14029]: managed-keys-zone ./IN: loading from master file managed-keys.bind failed: file not found

Thank s

Hi, in this case I should repeat what is already written very explicit in openSUSE documentation: openSUSE Documentation, you have both description of configuration files (line by line and with examples) and configuration with YaST. Please read it and in case if you’ll have concrete questions then write here.

In my opinion you should use YaST, in several clicks you have fully working DNS server.

about primary zone, as far as I can see, it’s the same issue: you have defined in named.conf zone

zone “srv.lan” in {
type master;
file “/var/lib/named/master/web.lan.forward”;
};

and zone file you use again @ which means to use the name from named.conf, i.e. srv.lan