BDNS is offline and I don't know if they'll be back. I searched for similar public HTTP APIs but couldn't find one that works well enough. Preferably, we can use Dnspython to query an OpenNIC server.
import dns.resolver import requests def domain_to_ip(domain, dns_server='159.89.120.99'): '''Uses an OpenNIC server to resolve blockchain domains :param domain: str Domain or URL :param dns_server: str Optional, OpenNIC server :raises dns.resolver.NXDOMAIN: if `dns_server` fails to resolve `domain` ''' if '://' in domain: domain = domain.split('/')[2] res = dns.resolver.Resolver() res.nameservers = [dns_server] answers = res.resolve(domain) return [rdata.address for rdata in answers] ips = domain_to_ip('http://track2.bazar') if ips: r = requests.get('https://'+ips[0], verify=False) print(r)