XX-net/XX-Net · warning

get ip for %s fail:%r

Error message

get ip for %s fail:%r

What it means

DNS resolution of 'www.<top_domain>' failed while ip_manager tried to obtain an IP for a domain; that domain is skipped this round.

Source

Thrown at code/default/x_tunnel/local/cloudflare_front/ip_manager.py:82

        self.domain_map = self.load_domains()

    def get_ip_sni_host(self):
        now = time.time()
        for top_domain, info in self.domain_map.items():
            if info["links"] < 0:
                info["links"] = 0

            if info["links"] >= self.config.max_connection_per_domain:
                continue

            if info["fail_times"] and now - info["last_try"] < 60:
                continue

            sni = "www." + top_domain
            try:
                ip = socket.gethostbyname(sni)
            except Exception as e:
                self.logger.warn("get ip for %s fail:%r", sni, e)
                continue

            self.logger.debug("get ip:%s sni:%s", ip, sni)
            info["links"] += 1
            info["last_try"] = now
            return {
                "ip_str": ip,
                "sni": sni,
                "host": top_domain,
            }

        return None

    def _get_domain(self, top_domain):
        self.domain_map.setdefault(top_domain, {
                            "links": 0,
                            "fail_times": 0,
                            "last_try": 0.0

View on GitHub (pinned to cfa5bc17b6)

Solutions

  1. Check system DNS works (nslookup www.cloudflare.com)
  2. Prune dead domains from the saved domain list
  3. Use a working resolver / disable DNS hijacking
Defensive patterns

Strategy: fallback

Validate before calling

import socket
try:
    socket.gethostbyname(sni)
except socket.gaierror:
    skip_domain()

Prevention

When it happens

Trigger: get_ip_sni_host calls socket.gethostbyname('www.'+top_domain) and it raises (NXDOMAIN, timeout, no resolver).

Common situations: Dead/expired domains in the saved list; local DNS blocked or poisoned; offline machine.

Related errors


AI-assisted analysis of XX-net/XX-Net@cfa5bc17b6 (2026-08-27). Data as JSON: /api/errors/e9a811477249f524. Report an issue: GitHub.