I been playing around with this for a few days and hit a brick wall
The problem has been documented on this readme:
https://github.com/vahidhedayati/grails-localdns/blob/master/README.md
Basically I am trying to override a dns entry for a given hostname... so eventually have a local db table that holds entry other than actual dns and to override the actual ip's to what is on DB (for testing purposes where cetain hostnames will work on an internal IP)
def index() {
System.setProperty("sun.net.spi.nameservice.provider.1", "dns,"+LocalManagedDnsDescriptor.DNS_PROVIDER_NAME)
System.setProperty("sun.net.spi.nameservice.provider.2", "dns,sun")
Security.setProperty("networkaddress.cache.ttl", "0")
def hostName = "google.com"
def ipAddress = "192.168.1.4"
NameStore.getInstance().put(hostName, ipAddress)
performLookup(hostName)
render "done lookup"
}
Basically no matter what I tried The LocalManagedDns is not being triggered...