public static List<String> getDnsServers() throws NamingException {
		Hashtable<String, String> env = new Hashtable<>();
		env.put(Context.INITIAL_CONTEXT_FACTORY, "com.sun.jndi.dns.DnsContextFactory");
		DirContext ctx = null;
		List<String> dnsServers = new ArrayList<>();
		try {
			ctx = new InitialDirContext(env);
			String dnsString = (String) ctx.getEnvironment().get("java.naming.provider.url");
			for (String each : dnsString.split(" ")) {
				dnsServers.add(each.replace("dns://", ""));
			}
		} catch (Exception e) {
			NoOp.noOp();
		} finally {
			if (ctx != null) {
				ctx.close();
			}
		}
		return dnsServers;
	}
Get IP form the given string.
<p/>
If the given ipOrHost is host name, it tries to turn it into IP.
If the host name is not available, it returns 127.0.0.1 instead.
ff

@param ipOrHost textual representation of ip or host name
@return ip
ngrinder-core/src/main/java/net/grinder/util/NetworkUtils.java