Service-fabric: Does the Service Fabric DNS Service Overwrite My DNS Settings?

Created on 8 May 2018  Â·  5Comments  Â·  Source: microsoft/service-fabric

When developing on my local machine using the Service Fabric SDK, I tried changing my obtain DNS server address to auto but it keeps going back: network settings -> adapter settings.

One of my co-workers said that was Service Fabric doing that. I couldn't find anything about this. Is that true? Is that documented, somewhere?

image

Reference: First Issue Created

type-question

Most helpful comment

@spottedmahn

Yes, SF does overwrite the DNS server settings. What is the concern here?

We configure us to be the one of the DNS servers ( index 0) on the preferred adapter.

This is needed for the DNS functionality to work. DNS service names for the SF services are not public and can only be resolved by SF DNS Service. Hence, we need to be the first one to be hit for DNS resolution requests. We will talk to Naming service to get the IP Address of the requested service endpoint.

I am assuming this is OneBox environment. If your scenario doesn’t need DNS service you can turn it off.

Steps to turn it off:

Remove following node in the ClusterManifestTemplate.json files present under various sub directories [ C:\Program Files\Microsoft SDKs\Service Fabric\ClusterSetup\NonSecure, C:\Program Files\Microsoft SDKs\Service Fabric\ClusterSetup\Secure]

"addOnFeatures": [
  "DnsService"
]

All 5 comments

@spottedmahn

Yes, SF does overwrite the DNS server settings. What is the concern here?

We configure us to be the one of the DNS servers ( index 0) on the preferred adapter.

This is needed for the DNS functionality to work. DNS service names for the SF services are not public and can only be resolved by SF DNS Service. Hence, we need to be the first one to be hit for DNS resolution requests. We will talk to Naming service to get the IP Address of the requested service endpoint.

I am assuming this is OneBox environment. If your scenario doesn’t need DNS service you can turn it off.

Steps to turn it off:

Remove following node in the ClusterManifestTemplate.json files present under various sub directories [ C:\Program Files\Microsoft SDKs\Service Fabric\ClusterSetup\NonSecure, C:\Program Files\Microsoft SDKs\Service Fabric\ClusterSetup\Secure]

"addOnFeatures": [
  "DnsService"
]

Yes, SF does overwrite the DNS server settings.

I see, thanks for confirming @ninzavivek!

What is the concern here?

Not so much a concern, I just want to understand how things work and why my windows settings were getting reverted.

It was causing problems for me on my home Wifi. I don't have the details right now. Either way, it would be a separate issue.

Out of curiosity I wasn't having this issue until I very recently updated. The version running that I had installed had a system warning about not being the preferred DNS but I never noticed anything wrong with Service Fabric. I'm currently running with the addOnFeatures option removed and everything runs but with it on it severs my connection to our company VPN. The warning in the cluster did disappear after updating to the newer version however. Is the DNS service needed when running on a local dev machine since it's a single machine even when running with 5 nodes?

Is the expectation that override settings still remain when (dev) local-service-fabric cluster stops?

It's an old thread, but I'd like to add for @ninzavivek that this config doesn't always go well. Sometimes the DNS config is wiped so the client can't resolve any addresses at all. There is absolutely some code - somewhere - that you need to take a look at. Here is some of the observations I have made:

  • DNS Settings will be configured to use the local host, but no forward lookups are resolved. This renders the machine unable to communicate with anything other than local resources. Obviously that is a problem.
  • When reverting to "previous" settings, the DNS will be set to the value it had during boot, and this will be inserted as a static DNS configuration. If the DNS server is assigned through DHCP and the address changes, then the client becomes "stranded" with a wrong DNS server config, because it has now been set to a static address that is no longer correct.
  • When reverting to the initial local DNS value, sometimes a non-printable character will be added to the end of the address. This makes it impossible for Windows to use the address and as a result no DNS requests are resolved. Just a few moments ago I had to edit static DNS entry set as 10.0.0.1â–„ (running ipconfig /all showed no DNS serveres registered at all).

Generally speaking, I have spent too much time supporting developers with fixing DNS on their dev-workstations. We are happy Microsoft-devs and Gold partners, but leaving workstations with defunct DNS is problematic. You need to take another look at the code that does this, and get it sorted out.

(posted 28-02-2021 with DNS configs needing correction on this day - do you want to re-open the issue or create a new one?)

Was this page helpful?
0 / 5 - 0 ratings