anujdatar / duckdns-docker

Docker container for DuckDNS ip refresh
4 stars 1 forks source link

Log file access #2

Open anujdatar opened 1 year ago

anujdatar commented 1 year ago

Write ddns update logs to a logfile instead of simple stdout, as pointed out in #1

corasaniti commented 1 year ago

@anujdatar it is possible in the log file to include the IP address as follow

[Sun May 28 14:20:00 UTC 2023] DuckDNS update IP: xxx.xxx.xxx.xxx ok thanks again PC

anujdatar commented 1 year ago

Okay, so, the way DuckDNS's API works is you send an HTTPS request with auth credentials, and they guess your IPv4 address basaed on that request. This container actually does not know your IP at all.

The way most other DDNS services work is you send them your current IP address along with credentials. So during that process you need to figure out your IP using requests or some other method. Like my cloudflare-ddns or dynv6-ddns containers.

I do have a discord webhook container that sends a discord message when your IP address changes, but I don't think the latest version is online yet.

anujdatar commented 1 year ago

just as an fyi, if you want to quickly get your current IP address, you can use one of these commands:

Edit: just don't over use these API calls. They're amazing services that we should not abuse.

# for IPv4
curl -s https://ipv4.icanhazip.com
curl -s https://api.ipify.org

# for IPv6
curl -s https://ipv6.icanhazip.com
curl -s https://api6.ipify.org

# -s flag is optional

I have been meaning to add the discord webhook to all my DDNS containers based on a previous suggestion, but haven't gotten around to it yet. I'll do it eventually I suppose.

Let me know if that's something you'd want. Or if its just a log, that's fine too.

I stopped using DuckDNS because my ISP started using CG-NAT for IPv4, and started supporting IPv6. So DuckDNS suddenly became irrelevant overnight (for my use case). Stuff happens