DaemonForums  

Go Back   DaemonForums > NetBSD > NetBSD General

NetBSD General Other questions regarding NetBSD which do not fit in any of the categories below.

Reply
 
Thread Tools Display Modes
  #1   (View Single Post)  
Old 4 Weeks Ago
notooth notooth is offline
Shell Scout
 
Join Date: Jul 2015
Posts: 97
Red face Need help setting up a local DNS

Hello,

Can anyone help me fix my local DNS configuration?

/etc/resolv.conf
Code:
search laboratorio.local
nameserver 192.168.100.200
nameserver 8.8.8.8
/etc/named.conf
Code:
options {
        directory "/etc/namedb";
        allow-transfer { 192.168.100.0/24; };
        allow-query { 192.168.100.0/24; };
        listen-on port 53 { 192.168.100.1; };
};

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

zone "laboratorio.local" {
        type master;
        file "laboratorio.local";
};

zone "100.168.192.IN-ADDR.ARPA" {
        type master;
        file "100.168.192";
};

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" {
        type master;
        file "loopback.v6";
};
/etc/namedb/laboratorio.local
Code:
$TTL    3600
@       IN      SOA     laboratorio.local. hostmaster.laboratorio.local.  (
                                1999012100      ; Serial
                                3600            ; Refresh
                                300             ; Retry
                                3600000         ; Expire
                                3600 )          ; Minimum
                        IN      NS      laboratorio.local.
laboratorio.local.      IN      A       192.168.100.200
                        IN      AAAA    ::1
/etc/namedb/100.168.192
Code:
$TTL    3600
@       IN      SOA     laboratorio.local. hostmaster.laboratorio.local.  (
                                1999012100      ; Serial
                                3600            ; Refresh
                                300             ; Retry
                                3600000         ; Expire
                                3600 )          ; Minimum
        IN      NS      laboratorio.local.
200     IN      PTR     laboratorio.local.
Here is the error:
Code:
$ nslookup laboratorio.local
Server:         8.8.8.8
Address:        8.8.8.8#53

** server can't find laboratorio.local: NXDOMAIN
Reply With Quote
  #2   (View Single Post)  
Old 4 Weeks Ago
J65nko J65nko is offline
Administrator
 
Join Date: May 2008
Location: Budel - the Netherlands
Posts: 3,567
Default

According to /etc/resolv.conf a name lookup should first use your 192.168.100.200 local nameserver but for some reason it does not.

The nslookup command shows that the secondary fallback nameserver 8.8.8.8 nameserver of Google, which does not know anything about your local/private "laboratorio.local" domain, is being used.

Have you checked with $ netstat -an -f inet that your local nameserver is running and LISTENing on port 53 for both UDP and TCP?

See http://daemonforums.org/showthread.php?t=4471#post30543 for an example of what you should look for.
__________________
You don't need to be a genius to debug a pf.conf firewall ruleset, you just need the guts to run tcpdump
Reply With Quote
  #3   (View Single Post)  
Old 4 Weeks Ago
notooth notooth is offline
Shell Scout
 
Join Date: Jul 2015
Posts: 97
Default

I've set named=YES in /etc/rc.conf, but I don't see it running:
Code:
$ netstat -an -f inet
Active Internet connections (including servers)
Proto Recv-Q Send-Q  Local Address          Foreign Address        State
tcp        0      0  192.168.100.200.60181  95.170.82.241.80       FIN_WAIT_1
tcp        0      0  192.168.100.200.60182  113.171.69.17.443      ESTABLISHED
tcp        0      0  192.168.100.200.60183  113.171.68.81.443      ESTABLISHED
tcp        0      0  192.168.100.200.60184  95.170.82.241.80       TIME_WAIT
tcp        0      0  192.168.100.200.60185  95.170.82.241.80       TIME_WAIT
tcp        0      0  192.168.100.200.60186  95.170.82.241.80       TIME_WAIT
tcp        0      0  192.168.100.200.60187  95.170.82.241.80       TIME_WAIT
tcp        0      0  192.168.100.200.60190  95.170.82.241.80       TIME_WAIT
tcp        0      0  192.168.100.200.60191  95.170.82.241.80       TIME_WAIT
tcp        0      0  192.168.100.200.60192  95.170.82.241.80       TIME_WAIT
tcp        0      0  192.168.100.200.60195  172.217.26.130.443     ESTABLISHED
tcp        0      0  192.168.100.200.60197  172.217.25.2.443       ESTABLISHED
tcp        0      0  192.168.100.200.60198  172.217.31.226.443     ESTABLISHED
tcp        0      0  192.168.100.200.60199  172.217.24.194.443     ESTABLISHED
tcp        0      0  192.168.100.200.60200  216.58.220.206.443     ESTABLISHED
tcp        0      0  192.168.100.200.60201  172.217.26.131.443     ESTABLISHED
tcp        0      0  192.168.100.200.60202  172.217.161.161.443    ESTABLISHED
tcp        0      0  192.168.100.200.60213  216.58.199.110.443     ESTABLISHED
tcp        0      0  192.168.100.200.60230  152.195.62.8.443       ESTABLISHED
tcp        0      0  192.168.100.200.60246  172.217.163.228.443    ESTABLISHED
tcp        0      0  192.168.100.200.60347  31.13.95.12.443        ESTABLISHED
tcp        0  10000  192.168.100.200.60394  122.58.98.98.24189     ESTABLISHED
tcp        0      0  192.168.100.200.60484  64.233.189.189.443     ESTABLISHED
tcp        0      0  192.168.100.200.60548  172.217.161.163.443    ESTABLISHED
tcp        0      0  192.168.100.200.61594  210.171.155.109.14116  ESTABLISHED
tcp        0      0  192.168.100.200.61969  31.13.95.8.443         ESTABLISHED
tcp        0      0  192.168.100.200.61970  31.13.95.36.443        ESTABLISHED
tcp        0      0  127.0.0.1.63342        *.*                    LISTEN
tcp        0      0  127.0.0.1.6942         *.*                    LISTEN
tcp        0      0  192.168.100.200.62191  31.13.95.8.443         ESTABLISHED
tcp        0      0  *.51413                *.*                    LISTEN
tcp        0      0  127.0.0.1.953          *.*                    LISTEN
udp        0      0  *.*                    *.*                   
udp        0      0  *.51413                *.*                   
udp        0      0  *.*                    *.*                   
udp        0      0  *.*                    *.*

Last edited by notooth; 4 Weeks Ago at 03:43 PM.
Reply With Quote
  #4   (View Single Post)  
Old 4 Weeks Ago
J65nko J65nko is offline
Administrator
 
Join Date: May 2008
Location: Budel - the Netherlands
Posts: 3,567
Default

You could manually start the nameserver named in the foreground with increasing log level to see what is going on.

From named(8):
Code:
       -d debug-level
           Set the daemon's debug level to debug-level. Debugging traces from
           named become more verbose as the debug level increases.
       -g
           Run the server in the foreground and force all logging to stderr.
.

The "SEE ALSO" section of that same man page refers to two utilities that you can use to check your name configuration:
__________________
You don't need to be a genius to debug a pf.conf firewall ruleset, you just need the guts to run tcpdump

Last edited by J65nko; 4 Weeks Ago at 11:46 PM.
Reply With Quote
  #5   (View Single Post)  
Old 4 Weeks Ago
notooth notooth is offline
Shell Scout
 
Join Date: Jul 2015
Posts: 97
Default

I checked the configuration and manually started the server named:

Code:
$ named-checkconf /etc/named.conf

$ named-checkzone laboratorio.local /etc/namedb/laboratorio.local
zone laboratorio.local/IN: loaded serial 1999012100
OK

$ named-checkzone 100.168.192.in-addr.zrpa /etc/namedb/100.168.192
zone 100.168.192.in-addr.zrpa/IN: loaded serial 1999012100
OK

$ doas sh /etc/rc.d/named stop           
Stopping named.

$ doas sh /etc/rc.d/named start -d 5 -g
Starting named.

$ netstat -an -f inet
Active Internet connections (including servers)
Proto Recv-Q Send-Q  Local Address          Foreign Address        State
tcp        0      0  127.0.0.1.953          *.*                    LISTEN
tcp        0      0  192.168.100.200.59261  172.217.31.238.443     ESTABLISHED
tcp        0      0  192.168.100.200.59264  192.112.36.4.53        TIME_WAIT
tcp        0      0  192.168.100.200.59282  192.203.230.10.53      TIME_WAIT
tcp        0      0  192.168.100.200.59283  192.203.230.10.53      TIME_WAIT
tcp        0      0  192.168.100.200.59301  107.178.240.89.443     ESTABLISHED
tcp        0      0  192.168.100.200.59303  172.217.161.162.443    ESTABLISHED
tcp        0      0  192.168.100.200.59315  172.217.26.142.443     TIME_WAIT
tcp        0      0  192.168.100.200.59316  107.178.254.65.443     TIME_WAIT
tcp        0      0  192.168.100.200.59317  185.84.60.30.443       TIME_WAIT
tcp        0      0  192.168.100.200.59318  172.217.31.238.443     TIME_WAIT
tcp        0      0  192.168.100.200.59325  89.187.162.46.443      TIME_WAIT
tcp        0      0  192.168.100.200.59326  172.217.31.237.443     TIME_WAIT
tcp        0      0  192.168.100.200.59337  13.228.63.189.443      TIME_WAIT
tcp        0      0  192.168.100.200.59338  35.190.72.21.443       TIME_WAIT
tcp        0      0  192.168.100.200.59340  147.75.111.32.443      TIME_WAIT
tcp        0      0  192.168.100.200.59350  52.196.43.180.443      TIME_WAIT
tcp        0      0  192.168.100.200.59355  103.229.205.253.443    ESTABLISHED
tcp        0      0  192.168.100.200.59356  13.75.115.40.443       TIME_WAIT
tcp        0      0  192.168.100.200.59360  104.16.77.166.443      TIME_WAIT
tcp        0      0  192.168.100.200.59361  104.16.77.166.443      TIME_WAIT
tcp        0      0  192.168.100.200.59362  104.16.171.188.443     TIME_WAIT
tcp        0      0  192.168.100.200.59367  108.177.125.154.443    TIME_WAIT
tcp        0      0  192.168.100.200.59368  172.217.24.198.443     TIME_WAIT
tcp        0      0  192.168.100.200.59370  192.0.76.3.443         TIME_WAIT
tcp        0      0  192.168.100.200.59372  192.0.76.3.443         TIME_WAIT
tcp        0      0  192.168.100.200.59373  151.139.128.14.80      LAST_ACK
tcp        0      0  192.168.100.200.59375  172.217.24.198.443     TIME_WAIT
tcp        0      0  192.168.100.200.59378  54.153.63.166.443      TIME_WAIT
tcp        0      0  192.168.100.200.59380  192.0.77.32.443        TIME_WAIT
tcp        0      0  192.168.100.200.59383  172.217.161.170.443    TIME_WAIT
tcp        0      0  192.168.100.200.59385  172.217.161.142.443    TIME_WAIT
tcp        0      0  192.168.100.200.59386  216.58.199.110.443     TIME_WAIT
tcp        0      0  192.168.100.200.59387  182.161.72.137.443     TIME_WAIT
tcp        0      0  192.168.100.200.59389  216.58.204.35.443      ESTABLISHED
tcp        0      0  192.168.100.200.59390  216.58.220.193.443     ESTABLISHED
tcp        0      0  192.168.100.200.59391  172.217.25.1.443       TIME_WAIT
tcp        0      0  192.168.100.200.59398  3.220.216.41.443       TIME_WAIT
tcp        0      0  192.168.100.200.59399  3.220.216.41.443       ESTABLISHED
tcp        0      0  192.168.100.200.59400  216.58.220.194.443     TIME_WAIT
tcp        0      0  192.168.100.200.59401  104.16.92.60.443       TIME_WAIT
tcp        0      0  192.168.100.200.59402  172.217.24.66.443      ESTABLISHED
tcp        0      0  192.168.100.200.59404  216.58.220.194.443     ESTABLISHED
tcp        0      0  192.168.100.200.59405  172.217.163.238.443    TIME_WAIT
tcp        0      0  192.168.100.200.59406  23.50.15.240.443       ESTABLISHED
tcp        0      0  192.168.100.200.59407  216.58.200.67.443      TIME_WAIT
tcp        0      0  192.168.100.200.59408  104.17.64.4.443        TIME_WAIT
tcp        0      0  192.168.100.200.59409  192.0.73.2.443         TIME_WAIT
tcp        0      0  192.168.100.200.59410  216.58.220.202.443     ESTABLISHED
tcp        0      0  192.168.100.200.59411  104.27.156.177.443     TIME_WAIT
tcp        0      0  192.168.100.200.59412  216.58.199.2.443       ESTABLISHED
tcp        0      0  192.168.100.200.59413  172.217.24.66.443      ESTABLISHED
tcp        0      0  192.168.100.200.59414  216.58.200.2.443       ESTABLISHED
tcp        0      0  192.168.100.200.59415  172.217.161.142.443    TIME_WAIT
tcp        0      0  192.168.100.200.59416  216.58.200.67.443      ESTABLISHED
tcp        0      0  192.168.100.200.59431  49.213.114.134.443     ESTABLISHED
tcp        0      0  192.168.100.200.59435  172.217.26.132.443     ESTABLISHED
tcp        0      0  192.168.100.200.59558  172.217.26.131.443     ESTABLISHED
tcp        0      0  192.168.100.200.59561  108.177.125.189.443    ESTABLISHED
tcp        0      0  192.168.100.200.59800  49.213.114.121.443     ESTABLISHED
tcp        0      0  192.168.100.200.59802  49.213.114.122.443     ESTABLISHED
tcp        0      0  127.0.0.1.63342        *.*                    LISTEN
tcp        0      0  127.0.0.1.6942         *.*                    LISTEN
tcp        0      0  192.168.100.200.61542  157.240.25.35.443      ESTABLISHED
tcp        0      0  192.168.100.200.62620  157.240.25.20.443      ESTABLISHED
tcp        0      0  192.168.100.200.65009  157.240.25.20.443      ESTABLISHED
tcp        0      0  *.51413                *.*                    LISTEN
udp        0      0  *.*                    *.*                   
udp        0      0  *.51413                *.*                   
udp        0      0  *.*                    *.*                   
udp        0      0  *.*                    *.*

Last edited by notooth; 4 Weeks Ago at 01:38 PM.
Reply With Quote
  #6   (View Single Post)  
Old 4 Weeks Ago
J65nko J65nko is offline
Administrator
 
Join Date: May 2008
Location: Budel - the Netherlands
Posts: 3,567
Default

You have configured 192.168.100.1 as the IP address on which the nameserver should LISTEN on
Code:
listen-on port 53 { 192.168.100.1; };
Your netstat output however shows 192.168.100.200 address ;-)
__________________
You don't need to be a genius to debug a pf.conf firewall ruleset, you just need the guts to run tcpdump
Reply With Quote
  #7   (View Single Post)  
Old 3 Weeks Ago
notooth notooth is offline
Shell Scout
 
Join Date: Jul 2015
Posts: 97
Default

I just fixed the problem. Thank you for your help.
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
out of space in /usr/local rdikarlus OpenBSD General 2 29th December 2018 08:41 PM
mysql won't run via rc.local benben159 OpenBSD Packages and Ports 3 8th August 2010 02:41 PM
log from rc.conf.local and rc.local sdesilet OpenBSD General 1 21st January 2010 02:37 AM
local dns (dnsmasq) bsdperson FreeBSD Ports and Packages 3 3rd September 2008 06:48 AM
proxy : replace gif with local gif milo974 OpenBSD General 4 17th July 2008 06:45 AM


All times are GMT. The time now is 04:58 PM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
Content copyright © 2007-2010, the authors
Daemon image copyright ©1988, Marshall Kirk McKusick