Java - use system DNS server settings -


i'm running dnsmasq on osx local offline development, , i've added 127.0.0.1 top dns server in network settings. works expected in terminal.

my java tests don't seem using local dns server, pain that's main reason needed it!

what configuration needed java pick system dns settings? need pass jvm system properties telling ise localhost?

yes, need update system settings use local dns.

system.setproperty("sun.net.spi.nameservice.nameservers", "127.0.0.1"); system.setproperty("sun.net.spi.nameservice.provider.1", "dns,sun"); 

Comments