SChernykh / p2pool

Decentralized pool for Monero mining
GNU General Public License v3.0
1.03k stars 124 forks source link

`nodes.hashvault.pro` cannot be resolved #229

Closed hinto-janai closed 1 year ago

hinto-janai commented 1 year ago

P2Pool errors with:

P2Pool resolve_host failed for nodes.hashvault.pro

when trying to connect to nodes.hashvault.pro with:

./p2pool --wallet <WALLET> --host nodes.hashvault.pro --rpc-port 18081 --zmq-port 18083

Connecting to the raw IP works fine though:

ping nodes.hashvault.pro
PING nodes.hashvault.pro (185.240.242.36) 56(84) bytes of data.

./p2pool --wallet <WALLET> --host 185.240.242.36 --rpc-port 18081 --zmq-port 18083

The .pro TLD is included in this list by ICANN: https://data.iana.org/TLD/tlds-alpha-by-domain.txt so this might be a bug in P2Pool's domain parsing?

SChernykh commented 1 year ago

There's no domain parsing. Whatever you pass in command line goes directly to https://man7.org/linux/man-pages/man3/getaddrinfo.3.html - standard DNS resolver provided by an OS you use.

Edit: p2pool.exe --wallet <WALLET> --loglevel 4 --mini --host nodes.hashvault.pro works just fine for me.

SChernykh commented 1 year ago

It's possible that your DNS server blocks mining pools.

SChernykh commented 1 year ago

Were you using the pre-built static Linux binary? It looks like Alpine Linux that I use for building the static binary doesn't like .pro domains. ping nodes.hashvault.pro gives "bad address" error there. And since it's built statically, DNS resolver is taken from there too.

hinto-janai commented 1 year ago

Yup, using pre-built v2.7 for Linux. Pre-built Windows/macOS binaries seem to work (tested in Windows 11 & macOS Big Sur 11.7.1 VM) the Linux one does not, and I'm not sure about BSD.

Self compiled p2pool on Linux does work though, so yeah, it seems like an issue in Alpine's DNS resolver.

SChernykh commented 1 year ago

@hinto-janaiyo This is not a problem with .pro domains - you can try any other domain like site.pro, orzi.pro and p2pool will get an IP address. It's something specific about hashvault.pro

SChernykh commented 1 year ago

I'll change the way I build Linux release binary starting from v3.0

SChernykh commented 1 year ago

I found out what's wrong with hashvault.pro:

Nameserver ns11.hashvault.pro/198.251.90.6 answered AAAA query with an unexpected rcode (NXDOMAIN).
Nameserver ns21.hashvault.pro/198.251.90.217 answered AAAA query with an unexpected rcode (NXDOMAIN).

It doesn't have AAAA (IPv6) DNS record and Alpine's DNS resolver ignores IPv4 and returns an error. I think I know how to fix it on p2pool's side.

SChernykh commented 1 year ago

Fixed in https://github.com/SChernykh/p2pool/commit/c7ba11c607c922d2bd346dff178b9f55fd4e8617

hinto-janai commented 1 year ago

Confirming https://github.com/SChernykh/p2pool/commit/c7ba11c607c922d2bd346dff178b9f55fd4e8617 works:

./p2pool --wallet [...] --loglevel 6 --host nodes.hashvault.pro

2023-01-27 06:29:33.6819 Log started
2023-01-27 06:29:33.6831 P2Pool v2.7 (built with GCC/12.2.1 on Jan 27 2023)
2023-01-27 06:29:33.7218 Util nodes.hashvault.pro resolved to 185.240.242.36
SChernykh commented 1 year ago

Did you test it on Alpine Linux? I tested it on Alpine and it worked.

hinto-janai commented 1 year ago

Tested and works on Arch, Ubuntu 20.04, Debian 11.

Alpine 3.17 works too:

2023-01-27 15:02:25.8827 Util getaddrinfo failed for nodes.hashvault.pro: Try again, retrying with IPv4 only
2023-01-27 15:02:25.8830 Util nodes.hashvault.pro resolved to 185.240.242.36