TRY THIS Rpi 2020.3 add-fqdn returns IPv6 address on IPv4 ADSL

ostridge

Guru
Joined
Jan 22, 2015
Messages
1,813
Reaction score
625
# add-fqdn at Line 20
# iptest=`nslookup $2 | tail -2 | cut -f 2 -d " " | head -n 1`

Code:
root@incrediblepbx:~# nslookup pbxinaflash.com | tail -2 | cut -f 2 -d " " | head -n 1
2606:4700:20::681a:5b8
root@incrediblepbx:~#
_____________________________________________________
Code:
#add-fqdn at line 19 (Raspi13-12)
#iptest=`nslookup $2 | tail -2 | cut -f 2 -d " " | head -n 1`


root@raspi-13:~# nslookup pbxinaflash.com | tail -2 | cut -f 2 -d " " | head -n 1
104.26.5.184
root@incrediblepbx:~#
root@raspi-13:~# nslookup sipgate.co.uk | tail -2 | cut -f 2 -d " " | head -n 1
217.10.79.23
root@raspi-13:~#
 
Disabling IPv6 won't prevent nslookup from returning an IPv6 address if the upstream server sends it. Set -type=A on the command line or grep it away.

From a buster host:

IPv6 is disabled (and was at boot)
Code:
root@pi4dev:~# sysctl net.ipv6.conf.all.disable_ipv6 net.ipv6.conf.default.disable_ipv6
net.ipv6.conf.all.disable_ipv6 = 1
net.ipv6.conf.default.disable_ipv6 = 1


nslookup version:
Code:
root@pi4dev:~# nslookup -version
nslookup 9.11.5-P4-5.1-Raspbian


Lookup addresses:
Code:
root@pi4dev:~# nslookup www.google.com 1.1.1.1
Server:         1.1.1.1
Address:        1.1.1.1#53

Non-authoritative answer:
Name:   www.google.com
Address: 172.217.164.36
Name:   www.google.com
Address: 2607:f8b0:4002:c08::67


root@pi4dev:~# nslookup -type=A www.google.com 1.1.1.1
Server:         1.1.1.1
Address:        1.1.1.1#53

Non-authoritative answer:
Name:   www.google.com
Address: 172.217.164.36
 
Last edited:
Any idea how it was disabled. There was nothing in /etc/sysctl.conf ?
I didn't mean to imply it is disabled by default on @wardmundy's image. Just showing that nslookup can return v6 addresses even if ipv6 is disabled.

FWIW, i always disable ipv6 (unless it's needed for some reason).
 
Lookup addresses:
Code:
root@incrediblepbx:~#  nslookup  sipgate.co.uk
Server:         51.254.25.115
Address:        51.254.25.115#53

Non-authoritative answer:
Name:   sipgate.co.uk
Address: 217.10.79.23
Name:   sipgate.co.uk
Address: 2001:ab7::7
Name:   sipgate.co.uk
Address: 2001:ab7::6
Name:   sipgate.co.uk
Address: 2001:ab7::8
Name:   sipgate.co.uk
Address: 2001:ab7::5

root@incrediblepbx:~# nslookup -type=AAAA sipgate.co.uk |grep ddress:  | tail -2 | cut -f 2 -d " " | head -n 1
2001:ab7::5

root@incrediblepbx:~# nslookup -type=A sipgate.co.uk |grep ddress:  |tail -2| cut -f 2 -d " " | head -n 1
Address:        51.254.25.115#53 # no this is the dns server

root@incrediblepbx:~# nslookup -type=A sipgate.co.uk |grep ddress:  |tail -1| cut -f 2 -d " " | head -n 1
217.10.79.23
root@incrediblepbx:~#
root@incrediblepbx:~# nslookup -type=A sipgate.co.uk |tail -2| cut -f 2 -d " " | head -n 1
217.10.79.23
nslookup -type=A sipgate.co.uk |grep ddress:|tail -1| cut -f 2 -d " " | head -n 1
217.10.79.23
For the record this is the edit from line 19 of add-fqdn found in ipbx13-12
Code:
root@raspi-13:~# nslookup sipgate.co.uk | tail -2 | cut -f 2 -d " " | head -n 1
217.10.79.23

I'm thinking or maybe wishing - that maybe the script could harvest and whitelist the Ip4 and IP6 addresses where there are several?
 
Last edited:
The update worked OK thanks; but there is a harmless and minor inaccuracy - the text showing in ssh session upon the update is
"Checking for update20209. INSTALLED: TM3 add-fqdn update for IPv6 use"

I'm thinking that it isnt really for IP6 use rather to return IP4 address.
 

Members online

No members online now.

Forum statistics

Threads
26,688
Messages
174,412
Members
20,259
Latest member
Fadeek86
Get 3CX - Absolutely Free!

Link up your team and customers Phone System Live Chat Video Conferencing

Hosted or Self-managed. Up to 10 users free forever. No credit card. Try risk free.

3CX
A 3CX Account with that email already exists. You will be redirected to the Customer Portal to sign in or reset your password if you've forgotten it.
Back
Top