1
24.1 Legacy Series / Re: unbound cannot resolve dns entries from LAN ISC DHCP Lease when they are offline
« on: July 24, 2024, 12:17:54 pm »
thanks for pointing out the script, I will try and fix it from here.
This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.
Yeah, neither do we. We do it for clients that are supposed to be in DNS permanently and not change their IPs - which certainly is not every single piece of random equipment out there sending out its hostname that's supposed to be trusted by DNS. The whole "feature" is a hack, not something integrated in Unbound and ISC DHCP (unlike Windows AD, now that you've mentioned it)
Related: this "feature" is currently missing altogether in Kea DHCP... https://github.com/opnsense/core/issues/7475
#!/usr/local/bin/bash
IP_HOSTNAMES=$(awk '/lease / {ip=$2} /client-hostname/ {print ip, $2}' /var/dhcpd/var/db/dhcpd.leases | tr -d '";')
COUNT=0
while IFS= read -r line; do
HOST=$(echo $line | cut -f2 -d' ')
grep $HOST /var/unbound/dhcpleases.conf >/dev/null || {
echo "$HOST is in dhcpd//dhcpd.leases but not found in unbound/dhcpleases.conf"
}
COUNT=$(($COUNT+1))
done <<< "$IP_HOSTNAMES"
echo "---"
echo "$COUNT total records in dhcpd//dhcpd.leases"
./unbound_dhcp_check.sh
RS is in dhcpd//dhcpd.leases but not found in unbound/dhcpleases.conf
LGwebOSTV is in dhcpd//dhcpd.leases but not found in unbound/dhcpleases.conf
PX-i7 is in dhcpd//dhcpd.leases but not found in unbound/dhcpleases.conf
LGwebOSTV is in dhcpd//dhcpd.leases but not found in unbound/dhcpleases.conf
---
24 total records in dhcpd//dhcpd.leases
Tip
In order to use features as policy based routing or manual routes, you can assign the underlying devices and use them in a similar fashion as physical interfaces.
Secure Shell Server [x] Enable Secure Shell
Login Group wheel, admins
Root Login [x] Permit root user login
Authentication Method [x] Permit password login
SSH port 22
Listen Interfaces LAN
:~ # netstat -an | grep 22
tcp4 0 0 192.168.1.1.22 *.* LISTEN
tcp4 0 0 127.0.0.1.22 *.* LISTEN
tcp6 0 0 ::1.22 *.* LISTEN
igb2: flags=8863<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500
description: LAN
options=4800028<VLAN_MTU,JUMBO_MTU,NOMAP>
ether dc:58:bc:e0:24:7b
inet 192.168.1.1 netmask 0xffffff00 broadcast 192.168.1.255
inet6 fe80::<redacted>:247b%igb2 prefixlen 64 scopeid 0x3
inet6 2a00:<redacted>:247b prefixlen 64
media: Ethernet autoselect (1000baseT <full-duplex>)
status: active
nd6 options=21<PERFORMNUD,AUTO_LINKLOCAL>
check file openvpn with path "/var/log/openvpn.log"
syntax doesn't work with dynamic file names? That would lead to having to use a program output content test with a bash script that collects the correct log data. But it is limited to 511 characters which means depending on the monit checking interval it could miss data.DNS failure while trying to find address 168.78.123.119.bl.spamcop.net in blacklist SpamCop
DNS failure while trying to find address 168.78.123.119.bl.spamcop.net in blacklist SpamCop
DNS failure while trying to find address 168.78.123.119.zen.spamhaus.org in blacklist SpamHaus SBL-XBL
DNS failure while trying to find address 168.78.123.119.db.wpbl.info in blacklist WPBL - Weighted Private Block List
DNS failure while trying to find address 168.78.123.119.db.wpbl.info in blacklist WPBL - Weighted Private Block List
drill @192.168.200.1 168.78.123.119.db.wpbl.info
;; ->>HEADER<<- opcode: QUERY, rcode: NOERROR, id: 9656
;; flags: qr rd ra ; QUERY: 1, ANSWER: 0, AUTHORITY: 2, ADDITIONAL: 0
;; QUESTION SECTION:
;; 168.78.123.119.db.wpbl.info. IN A
;; ANSWER SECTION:
;; AUTHORITY SECTION:
db.wpbl.info. 86145 IN NS ns2.wpbl.info.
db.wpbl.info. 86145 IN NS ns1.wpbl.info.
;; ADDITIONAL SECTION:
;; Query time: 0 msec
;; SERVER: 192.168.200.1
;; WHEN: Thu Oct 1 10:55:30 2020
;; MSG SIZE rcvd: 81
# cat /etc/resolv.conf
domain xxx.local
nameserver 185.xx.yy.zz
nameserver 185.xx.yy.ww
nameserver 8.8.8.8
nameserver 192.168.200.101