Giter Site home page Giter Site logo

Comments (11)

TimothyYe avatar TimothyYe commented on August 22, 2024 1

@diizzyy Thanks, I'll look into this issue.

from godns.

diizzyy avatar diizzyy commented on August 22, 2024

Still busy or is this something you can look into? @TimothyYe
It appears to be a simple parsing bug

from godns.

biship avatar biship commented on August 22, 2024

Same problem on windows. "ip_interface": "wgpia0",

time="2023-09-07T16:09:24-04:00" level=info msg="Creating DNS handler with provider: DuckDNS"
time="2023-09-07T16:09:24-04:00" level=info msg="GoDNS started, starting the DNS manager..."
time="2023-09-07T16:09:24-04:00" level=error msg="Cannot get IP:Get "": unsupported protocol scheme """
time="2023-09-07T16:09:24-04:00" level=error msg="get ip online failed. Fallback to get ip from interface if possible."
time="2023-09-07T16:09:24-04:00" level=error msg="get ip from interface failed. There is no more ways to try."
time="2023-09-07T16:09:24-04:00" level=error msg="can't get a vaild address from wgpia0"
time="2023-09-07T16:09:24-04:00" level=debug msg="DNS update loop finished, will run again in 300 seconds"

from godns.

diizzyy avatar diizzyy commented on August 22, 2024

@TimothyYe
Can you possibly have a look at this?

from godns.

TimothyYe avatar TimothyYe commented on August 22, 2024

ERRO[0000] Cannot get IP:Get "": unsupported protocol scheme ""

@diizzyy I've checked the code, this error means GoDNS still tries to get the IP address from the internet.

I think to fix this issue, update your config as:

{
  "ip_type": "IPv4",
  "ip_interface": "hn0",
  "interval": 300,
  "debug_info": true,
  "run_once": true
}

Just remove ip_urls from it.
By the way, I've released a new version to fix this problem and filter the empty URLs in the ip_urls option.

from godns.

diizzyy avatar diizzyy commented on August 22, 2024

@TimothyYe
Hi, still doesn't work unfortunately

  "ip_type": "IPv4",
  "ip_interface": "hn0",
  "interval": 300,
  "debug_info": true,
  "run_once": true

INFO[0000] GoDNS started, starting the DNS manager...
ERRO[0000] get ip from interface failed. There is no more ways to try.
ERRO[0000] Error during execution:fail to get current IP

Also the syntax is from the manual,
https://github.com/TimothyYe/godns#network-interface-ip-address

from godns.

TimothyYe avatar TimothyYe commented on August 22, 2024

Could you please help to run the ifconfig command, and paste the output for your network interface hn0 here?
I guess the only difference between GoDNS and the code snippet you mentioned is that GoDNS checks if the IP is private:

https://github.com/TimothyYe/godns/blob/master/pkg/lib/ip_helper.go#L122

from godns.

TimothyYe avatar TimothyYe commented on August 22, 2024

I use my Oracle cloud to test GoDNS on the FreeBSD system, and the same error shows when the network interface is assigned with a private IP address:

image

For the current implementation, GoDNS will ignore the private IP address while fetching it from the network interface.

from godns.

diizzyy avatar diizzyy commented on August 22, 2024

Ahh, you're correct! I should've checked the code more carefully but it would be nice if godns where verbose about it especially in debug mode. There seems to be a loop however somewhere in the logic to detect IP?

INFO[0000] Creating DNS handler with provider: Infomaniak
INFO[0000] GoDNS started, starting the DNS manager...
DEBU[0000] get ip success from network intereface by: igb0, IP: NOT PRIVATE
DEBU[0000] get ip success from network intereface by: igb0, IP: NOT PRIVATE
INFO[0002] Update IP success: good NOT PRIVATE
DEBU[0002] Cached IP address: NOT PRIVATE

from godns.

TimothyYe avatar TimothyYe commented on August 22, 2024

It's not a loop, it only happens when the GoDNS is launched for the first time, the current_ip in the IPHelper is empty, so it tries to fetch the current IP address immediately. In this case, it produces one extra output log:
https://github.com/TimothyYe/godns/blob/master/pkg/lib/ip_helper.go#L71

Another log is produced by the inner goroutine inside the IPHelper:
https://github.com/TimothyYe/godns/blob/master/pkg/lib/ip_helper.go#L60

So you may see two output logs here.

from godns.

diizzyy avatar diizzyy commented on August 22, 2024

Thanks for clarifying, I guess we can close this now.

from godns.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.