Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot had more than one No-Ip domains #5830

Closed
champymarty opened this issue Oct 24, 2022 · 22 comments
Closed

Cannot had more than one No-Ip domains #5830

champymarty opened this issue Oct 24, 2022 · 22 comments
Labels
Bug 🐞 Solution available 🥂 Definite solution has been done
Milestone

Comments

@champymarty
Copy link

champymarty commented Oct 24, 2022

Creating a bug report/issue

Required Information

  • DietPi version
    G_DIETPI_VERSION_CORE=8
    G_DIETPI_VERSION_SUB=9
    G_DIETPI_VERSION_RC=2
    G_GITBRANCH='master'
    G_GITOWNER='MichaIng'

  • Distro version
    buster 0

  • Kernel version | uname -a
    Linux DietPi 5.10.103-v8+ #1529 SMP PREEMPT Tue Mar 8 12:26:46 GMT 2022 aarch64 GNU/Linux

  • SBC model | echo $G_HW_MODEL_NAME or (EG: RPi3)
    RPi 4 Model B (aarch64)

  • Power supply used
    Standard raspberry pi 4 power supply

  • SD card used
    SanDisk ultra 64 Gb

Additional Information (if applicable)

  • Software title
    dietpi-DDNS
  • Was the software title installed freshly or updated/migrated?
    It comes with dietpi os
  • Can this issue be replicated on a fresh installation of DietPi?
    Did not try
  • Bug report ID
    a8acf7cd-ed7b-488b-b36f-8df9df3e7050

Steps to reproduce

  1. Add a DDNS domain for NoIp
  2. Try adding a second one after the first

Expected behaviour

  • It should add bot domain

Actual behaviour

I get a error here:
image

  • ...

Extra details

  • ...
@Joulinar
Copy link
Collaborator

This is working as designed. Our script is not able to handle 2 domain atm.

@champymarty
Copy link
Author

oh, because when I do in domains, it says it can : "Please enter a comma-separated list of domains that shall point to this system: "

@Joulinar
Copy link
Collaborator

Joulinar commented Oct 24, 2022

ahhh sorry my fault. I was typing to fast, by bad. Issue is related to DNS as you are not able to resolve the NoIP update server address ping dynupdate.noip.com

can you check following

ping dynupdate.noip.com
cat /etc/resolv.conf

@champymarty
Copy link
Author

image
When I ping it I can access it

@champymarty
Copy link
Author

I have these DNS:
image

ALso the other domain is getting updated, and I have no internet problems

@MichaIng
Copy link
Owner

MichaIng commented Oct 24, 2022

Generally adding two domains that way comma-separated should work: https://www.noip.com/integrate/request
Can you simply retry? Probably there was a temporary network issue, since if ping is able to resolve, curl should be as well.

Btw, checking your bug report, you have dhcpcd5 installed while using a static IP. If this is an old system, it is likely a remain of old Pi-hole dependencies, while nowadays, Pi-hole does not required dhcpcd5 anymore, so you can remove it:

apt-mark auto dhcpcd5
apt autopurge

However, it is definitely disabled so not causing any issues in your case, which was a first guess I had.

@Joulinar
Copy link
Collaborator

btw, there is no need to create screen prints. You should be able to copy everything from SSH terminal directly. This is way more easier to handle 😃

@champymarty
Copy link
Author

champymarty commented Oct 24, 2022

I retried multiple time, at least 5 time. Always show the same result. I can try to remove dhcpcd5 put i think it was use with PiVPN, which I just reinstall. I also restarted it of course, and still same issue

@MichaIng
Copy link
Owner

Cam you try:

curl -I dynupdate.noip.com

@champymarty
Copy link
Author

I get :
root@DietPi:~# curl -I dynupdate.noip.com
HTTP/1.1 301 Moved Permanently
Server: nginx
Date: Mon, 24 Oct 2022 19:33:44 GMT
Content-Type: text/plain
Content-Length: 22
Connection: keep-alive
Location: http://www.noip.com
ETag: "62d50c84-16"

@MichaIng
Copy link
Owner

Confusing, this works fine. Can you test:

curl -L -u username:password https://dynupdate.noip.com/nic/update?hostname=host1.ddns.net,host2.ddns.net

replacing credentials and hosts. This is the exact command dietpi-ddns runs, besides hiding connection progress.

@champymarty
Copy link
Author

i get this:
root@DietPi:~# curl -L -u username:password https://dynupdate.noip.com/nic/update?hostname=host1.ddns.net,host2.ddns.net
badauth

@Joulinar
Copy link
Collaborator

Joulinar commented Oct 24, 2022

badauth

Did you adjust username:password with your own one?

as well host1.ddns.net,host2.ddns.net should match yours for testing.

@champymarty
Copy link
Author

it works ! It does:
nochg 24.201.119.96
nochg 24.201.119.96

But it does not work in dietpi-DDNS

@Joulinar
Copy link
Collaborator

how does it behabe using just 1 domain instaed of 2?

@champymarty
Copy link
Author

yes the dimain get updated on no ip with one domain

@MichaIng
Copy link
Owner

How is it possible that the same command works on console but does not work within the script 🤔. In dietpi-ddns is always results in this "Could not resolve host" error?

Can you test:

which curl
bash -c '. /boot/dietpi/func/dietpi-globals; G_INIT; curl -I dynupdate.noip.com'
bash -c '. /boot/dietpi/func/dietpi-globals; curl -I dynupdate.noip.com'
bash -c 'curl -I dynupdate.noip.com'

@champymarty
Copy link
Author

champymarty commented Oct 27, 2022

i get

root@DietPi:~# which curl
/usr/bin/curl
root@DietPi:~# bash -c '. /boot/dietpi/func/dietpi-globals; G_INIT; curl -I dynupdate.noip.com'
HTTP/1.1 301 Moved Permanently
Server: nginx
Date: Thu, 27 Oct 2022 22:56:28 GMT
Content-Type: text/plain
Content-Length: 22
Connection: keep-alive
Location: http://www.noip.com
ETag: "62d50c84-16"
root@DietPi:~# bash -c '. /boot/dietpi/func/dietpi-globals; curl -I dynupdate.noip.com'
HTTP/1.1 301 Moved Permanently
Server: nginx
Date: Thu, 27 Oct 2022 22:56:34 GMT
Content-Type: text/plain
Content-Length: 22
Connection: keep-alive
Location: http://www.noip.com
ETag: "62d50c7b-16"
root@DietPi:~# bash -c 'curl -I dynupdate.noip.com'
HTTP/1.1 301 Moved Permanently
Server: nginx
Date: Thu, 27 Oct 2022 22:56:39 GMT
Content-Type: text/plain
Content-Length: 22
Connection: keep-alive
Location: http://www.noip.com
ETag: "62d50c84-16"

root@DietPi:~#

@MichaIng
Copy link
Owner

MichaIng commented Nov 3, 2022

So it's not the clean script or G_INIT environment or dietpi-globals. I've absolutely no idea how in dietpi-ddns the curl call can do anything different 🤔.

Probably to check every step:

bash -x /boot/dietpi/dietpi-ddns

trigger the issue, then check or paste the whole console output (will be much) for any possible reason.

@champymarty
Copy link
Author

champymarty commented Nov 7, 2022

Thank you for your help ! When I try it i get the same error again :

[ INFO ] DietPi-DDNS | Testing DDNS update...
+ unset -f Print
+ local result
++ curl -6or4 -sSfL -u **masked_username**:**masked_pass** 'https://dynupdate.noip.com/nic/update?hostname=champymartyserver.ddns.net,champymartyserverpi.ddns.net'
+ result='curl: (6) Could not resolve host: dynupdate.noip.com'
+ G_DIETPI-NOTIFY 1 'DDNS update test failed, please check your input:\ncurl: (6) Could not resolve host: dynupdate.noip.com'
+ ainput_string=("$@")
+ local i ainput_string output_string grey green red reset yellow dietpi_green
+ [[ -t 0 ]]
+ output_string='\e[0m\r\e[J'
+ grey='\e[90m'
+ green='\e[32m'
+ red='\e[31m'
+ reset='\e[0m'
+ yellow='\e[33m'
+ dietpi_green='\e[38;5;154m'
+ [[ 1 != \-\2 ]]
+ [[ -w /tmp/dietpi-process.pid ]]
+ local 'bracket_l=\e[90m[\e[0m' 'bracket_r=\e[90m]\e[0m'
+ local 'ok=\e[90m[\e[0m\e[32m  OK  \e[90m]\e[0m ' 'failed=\e[90m[\e[0m\e[31mFAILED\e[90m]\e[0m '
+ ((  1 == -1  ))
+ ((  1 == -2  ))
+ ((  1 == 0  ))
+ ((  1 == 1  ))
+ output_string+='\e[90m[\e[0m\e[31mFAILED\e[90m]\e[0m '
+ ainput_string+=('\n')
+ Print 1
+ [[ 1 == 1 ]]
+ [[ -n DietPi-DDNS ]]
+ output_string+='\e[90mDietPi-DDNS |\e[0m '
+ (( i=1 ))
+ (( i<3 ))
+ output_string+='DDNS update test failed, please check your input:\ncurl: (6) Could not resolve host: dynupdate.noip.com'
+ (( i++ ))
+ (( i<3 ))
+ output_string+='\n'
+ (( i++ ))
+ (( i<3 ))
+ echo -ne '\e[0m\r\e[J\e[90m[\e[0m\e[31mFAILED\e[90m]\e[0m \e[90mDietPi-DDNS |\e[0m DDNS update test failed, please check your input:\ncurl: (6) Could not resolve host: dynupdate.noip.com\n\e[0m'
[FAILED] DietPi-DDNS | DDNS update test failed, please check your input:

MichaIng added a commit that referenced this issue Nov 8, 2022
- DietPi-DDNS | Resolved an issue where IPv6 was forced when if was chosen to not force any IP family. Many thanks to @champymarty for reporting this issue: #5830
@MichaIng MichaIng added this to the v8.11 milestone Nov 8, 2022
@MichaIng MichaIng added Bug 🐞 Solution available 🥂 Definite solution has been done and removed Investigating 🤔 labels Nov 8, 2022
@MichaIng
Copy link
Owner

MichaIng commented Nov 8, 2022

Found and fixed it: 70ed79e

The -6or4 argument, when choosing to not force any IP family, should have been unset before running curl. Unset was however -4or6 due to number twist 😅. It wasn't recognised if the DDNS provider has an AAAA (IPv6) record, since -6or4 are valid arguments, -6 forcing IPv6, then -or4 which writes the output to a file name r4. No-IP however has an A (IPv4) record only:

# getent ahosts dynupdate.noip.com
158.247.7.204   STREAM dynupdate.noip.com
158.247.7.204   DGRAM
158.247.7.204   RAW

MichaIng added a commit that referenced this issue Nov 19, 2022
- DietPi-DDNS | Correctly unset password "0" was input. Sending a dummy HTTP authentication header does not hurt, but is unnecessary.
- DietPi-DDNS | Patch update scripts affected by: #5830
@eikaramba
Copy link

super happy that i found this thread. i had the exact same problem and totally didn't understand why it wasn't working although i could ping the domain and everything. everyone else would have maybe just closed the ticket and blamed it on the user or something, but no michaelng keeps on delivering. just incredible! Sry just wanted to say how rare such dedication is nowadays.

TLDR: Same Problem, works now after 8.11 Release

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug 🐞 Solution available 🥂 Definite solution has been done
Projects
None yet
Development

No branches or pull requests

4 participants