- commit 70e4a461966825480c62eb44037b6fa3a15341c3 (HEAD -> master)
- Author: plowsof <plowsof@protonmail.com>
- Date: Thu May 7 20:08:28 2026 +0100
- same domain for all dns for testing
- diff --git a/src/common/dns_utils.cpp b/src/common/dns_utils.cpp
- index 48dab6961..c336b2a05 100644
- --- a/src/common/dns_utils.cpp
- +++ b/src/common/dns_utils.cpp
- @@ -503,16 +503,16 @@ bool load_txt_records_from_dns(std::vector<std::string> &good_records, const std
- do
- {
- const std::string &url = dns_urls[cur_index];
- - if (!avail[cur_index])
- - {
- - records[cur_index].clear();
- - LOG_PRINT_L2("DNSSEC not available for hostname: " << url << ", skipping.");
- - }
- - if (!valid[cur_index])
- - {
- - records[cur_index].clear();
- - LOG_PRINT_L2("DNSSEC validation failed for hostname: " << url << ", skipping.");
- - }
- + //if (!avail[cur_index])
- + //{
- + // records[cur_index].clear();
- + // LOG_PRINT_L2("DNSSEC not available for hostname: " << url << ", skipping.");
- + //}
- + //if (!valid[cur_index])
- + //{
- + // records[cur_index].clear();
- + // LOG_PRINT_L2("DNSSEC validation failed for hostname: " << url << ", skipping.");
- + //}
- cur_index++;
- if (cur_index == dns_urls.size())
- @@ -565,6 +565,38 @@ bool load_txt_records_from_dns(std::vector<std::string> &good_records, const std
- return true;
- }
- +bool load_chunked_txt_records_from_dns(std::vector<std::string> &good_records, const std::vector<std::string> &dns_urls)
- +{
- + if (dns_urls.empty()) return false;
- +
- + for (size_t chunk_idx = 0; ; ++chunk_idx)
- + {
- + std::vector<std::string> chunk_urls;
- + chunk_urls.reserve(dns_urls.size());
- + for (const auto &url : dns_urls)
- + chunk_urls.push_back(std::to_string(chunk_idx) + "." + url);
- +
- + std::vector<std::string> chunk_records;
- + if (!load_txt_records_from_dns(chunk_records, chunk_urls))
- + {
- + MDEBUG("DNS blocklist: no consensus for chunk " << chunk_idx << ", stopping after " << chunk_idx << " chunk(s)");
- + break;
- + }
- +
- + MDEBUG("Found chunk " << chunk_idx << " with " << chunk_records.size() << " record(s)");
- + for (const auto &s : chunk_records)
- + good_records.push_back(s);
- + }
- +
- + if (good_records.empty())
- + {
- + LOG_PRINT_L0("WARNING: no DNS blocklist chunks were successfully fetched");
- + return false;
- + }
- +
- + return true;
- +}
- +
- std::vector<std::string> parse_dns_public(const char *s)
- {
- unsigned ip0, ip1, ip2, ip3;
- diff --git a/src/common/dns_utils.h b/src/common/dns_utils.h
- index 334ac8a79..a763d76c0 100644
- --- a/src/common/dns_utils.h
- +++ b/src/common/dns_utils.h
- @@ -172,6 +172,11 @@ std::string get_account_address_as_str_from_url(const std::string& url, bool& dn
- bool load_txt_records_from_dns(std::vector<std::string> &records, const std::vector<std::string> &dns_urls);
- +// Distributed banlist
- +// For each chunk index i, query "{i}.base_domain" across all base_dns_urls
- +// Stops when a chunk yields no consensus (end-of-list signal).
- +bool load_chunked_txt_records_from_dns(std::vector<std::string> &records, const std::vector<std::string> &dns_urls);
- +
- std::vector<std::string> parse_dns_public(const char *s);
- } // namespace tools::dns_utils
- diff --git a/src/p2p/net_node.h b/src/p2p/net_node.h
- index 3052cca29..c5aa5b645 100644
- --- a/src/p2p/net_node.h
- +++ b/src/p2p/net_node.h
- @@ -478,7 +478,7 @@ namespace nodetool
- epee::math_helper::once_a_time_seconds<60*30, false> m_peerlist_store_interval;
- epee::math_helper::once_a_time_seconds<60> m_gray_peerlist_housekeeping_interval;
- epee::math_helper::once_a_time_seconds<3600, false> m_incoming_connections_interval;
- - epee::math_helper::once_a_time_seconds<7000> m_dns_blocklist_interval;
- + epee::math_helper::once_a_time_seconds<15> m_dns_blocklist_interval;
- std::list<epee::net_utils::network_address> m_priority_peers;
- std::vector<epee::net_utils::network_address> m_exclusive_peers;
- diff --git a/src/p2p/net_node.inl b/src/p2p/net_node.inl
- index ce2d5346a..85f8c2653 100644
- --- a/src/p2p/net_node.inl
- +++ b/src/p2p/net_node.inl
- @@ -2152,17 +2152,17 @@ namespace nodetool
- return true;
- static const std::vector<std::string> dns_urls = {
- - "blocklist.moneropulse.se"
- - , "blocklist.moneropulse.org"
- - , "blocklist.moneropulse.net"
- - , "blocklist.moneropulse.co"
- - , "blocklist.moneropulse.fr"
- - , "blocklist.moneropulse.de"
- - , "blocklist.moneropulse.ch"
- + "blocklist.monerodevs.org"
- + , "blocklist.monerodevs.org"
- + , "blocklist.monerodevs.org"
- + , "blocklist.monerodevs.org"
- + , "blocklist.monerodevs.org"
- + , "blocklist.monerodevs.org"
- + , "blocklist.monerodevs.org"
- };
- std::vector<std::string> records;
- - if (!tools::dns_utils::load_txt_records_from_dns(records, dns_urls))
- + if (!tools::dns_utils::load_chunked_txt_records_from_dns(records, dns_urls))
- return true;
- unsigned good = 0;
Untitled
Posted by Anonymous on Thu 7th May 2026 21:53
raw | new post
Submit a correction or amendment below (click here to make a fresh posting)
After submitting an amendment, you'll be able to view the differences between the old and new posts easily.
kpaste.net RSS