Assigning vhosts to Docker ports

This answer might be a bit late, but what you need is an automatic reverse proxy. I have used two solutions for that: jwilder/nginx-proxy Traefik With time, my preference is to use Traefik. Mostly because it is well documented and maintained, and comes with more features (load balancing with different strategies and priorities, healthchecks, circuit … Read more

Number in the top-level domain?

Does top-level domain can contain a number at the end? Yes technically, except if it is purely numerical, then it can not be a TLD, under current rules and for easy reasons to understand (to disambiguate with IP addresses). And it can not contain a number at the end, except if it is an IDN … Read more

java.net.UnknownHostException on Docker

In my case the java application was failing with java.net.UnknownHostException when running in docker. The reason was that I used –network=none docker flag (getting ip/hostname via dhcp and pipework). In this case, docker does not add automatically to /etc/hosts entry like 127.0.0.1 15e326aecf84 And getCanonicalHostName() Java function threw this exception. Possible solutions: add hostname entry … Read more

Reverse IP Domain Check?

After reading the comments, bobince is definitely right and these 2 should be used in tandem with each other. For best results you should use the reverse DNS lookup here as well as to use the passive DNS replication. string IpAddressString = “208.5.42.49”; //eggheadcafe try { IPAddress hostIPAddress = IPAddress.Parse(IpAddressString); IPHostEntry hostInfo = Dns.GetHostByAddress(hostIPAddress); // … Read more

GetHostEntry is very slow

Maybe this can help? The WayBack Machine version of the dead link. (Dead link: http://www.chapleau.info/blog/2008/09/09/reverse-dns-lookup-with-timeout-in-c.html) The code, for posterity: private delegate IPHostEntry GetHostEntryHandler(string ip); public string GetReverseDNS(string ip, int timeout) { try { GetHostEntryHandler callback = new GetHostEntryHandler(Dns.GetHostEntry); IAsyncResult result = callback.BeginInvoke(ip,null,null); if (result.AsyncWaitHandle.WaitOne(timeout, false)) { return callback.EndInvoke(result).HostName; } else { return ip; } } … Read more

Dns.BeginGetHost… methods blocking

System.Net.Dns uses the windows gethostbyname function for DNS queries and doesn’t really have asynchronous functions at all. The BeginGetHostEntry function is basically just a wrapper for a synchronous GetHostEntry invocation on the thread pool. Last time I had this same problem with slow/synchronous DNS lookups I eventually just used a large ThreadPool to get the … Read more

How to use Socks 5 proxy with Apache HTTP Client 4?

SOCK is a TCP/IP level proxy protocol, not HTTP. It is not supported by HttpClient out of the box. One can customize HttpClient to establish connections via a SOCKS proxy by using a custom connection socket factory EDIT: changes to SSL instead of plain sockets Registry<ConnectionSocketFactory> reg = RegistryBuilder.<ConnectionSocketFactory>create() .register(“http”, PlainConnectionSocketFactory.INSTANCE) .register(“https”, new MyConnectionSocketFactory(SSLContexts.createSystemDefault())) .build(); … Read more