microsoft / service-fabric

Service Fabric is a distributed systems platform for packaging, deploying, and managing stateless and stateful distributed applications and containers at large scale.
https://docs.microsoft.com/en-us/azure/service-fabric/
MIT License
3.01k stars 399 forks source link

Service Fabric DNS not resolving #1141

Open busadave13 opened 3 years ago

busadave13 commented 3 years ago

We are trying to enable DNS support in our SF cluster (Currently we use Reverse Proxy). Following this tutorial I have setup DNS on my local machine for testing. I'm testing with two different services using postman to call Service #1 with RP, Service #1 then calls Service #2 using DNS. This configuration fails to resolve with "No such host is known. [Endpoint: http://xpricecore.xpricecoreapp:9601/query/844427896190701])". I can however make the call using localhost:9601 and I can resolve against the loopback address 127.0.0.1 or the local IP

C:\WINDOWS\system32>nslookup -type=any xpricecore.xpricecoreapp 127.0.0.1 Server: localhost Address: 127.0.0.1 xpricecore.xpricecoreapp text ="http://MYHOSTNAME(redacted)9601" xpricecore.xpricecoreapp internet address = 10.125.76.137 xpricecore.xpricecoreapp SRV service location: priority = 0 weight = 0 port = 9601 svr hostname = MYHOSTNAME(redacted) (root) ??? unknown type 41 ???

Using ipconfig /all I can also see my IP address in the DNS Server list though it comes after the IPv6 addresses. Should my local IP be the first in the list and if so is there some configuration need to make this happen?

craftyhouse commented 3 years ago

What does nslookup do without specifying the resolver endpoint? That is what the service is most likely doing to so you should expect similar behavior. I would try what you suggest by making localhost/localip highest in the order and hope that helps.

busadave13 commented 3 years ago

Without the loopback address the resolution fails. I could of course modify the the DNS order or disable IPv6 all together but this is something we trying to roll out to production and I don't want to make those types of changes on a production machine if I don't have too. This configuration is taken from the SF documentation to configure DNS so seems like this may be a bug?

C:\WINDOWS\system32>nslookup xpricecore.xpricecoreapp 127.0.0.1 Server: localhost Address: 127.0.0.1

Name: xpricecore.xpricecoreapp Address: 10.125.76.137

C:\WINDOWS\system32>nslookup xpricecore.xpricecoreapp Server: UnKnown Address: 2001:4898::1050:1050

*** UnKnown can't find xpricecore.xpricecoreapp: Non-existent domain

craftyhouse commented 3 years ago

Similar question here for reference https://github.com/Microsoft/service-fabric/issues/124

Do you get the expected behavior if your actual host ip is the first resolver (not localhost/127)

busadave13 commented 3 years ago

Ok, so I disable IPv6 on my NIC and everything works as expected. Is there something that I can configure in SF to force the local IPv4 to the head of the list?