-
Notifications
You must be signed in to change notification settings - Fork 9.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
DNS resolution issues when connected to a VPN #3536
Comments
Is https://os-identity.vip.foo.com a resolvable domain? Additionally, is Keystone running on port 5443? It usually runs on port 5000. edit: err... I see. You simply swapped out versions of Terraform. Can you still confirm that the Keystone URL is resolvable? Is the domain an entry in If Terraform isn't resolving it, that might be a problem with Terraform core and not specifically OpenStack. Let me know 😄 |
I was also reading your description of the issue in #3345. Can you verify the problem either exists or doesn't exist with the latest, unmodified 0.6.6 binaries? |
I ran into this issue on a private OpenStack instance. For me, I'm logging in over a VPN on OS X and while I can hit the various endpoints in the browser (and resolve correctly via If I hardcode the IP addresses of the various OpenStack domain names, I can get it to work by editing my |
@bluk Thank you for the info! To confirm: When you are logged in over a VPN, you are then using a VPN-specific DNS resolver in order to resolve hosts/domains that are only accessible over the VPN? |
@jtopjian Yes, it's a VPN specific DNS resolver. |
@bluk OK, thanks. Does the VPN software update your |
I noticed there hasn't been activity on this issue in a while, but I am experiencing the same issue and @jtopjian I can confirm that the VPN software does NOT update /etc/resolv.conf (at least not in my case). The VPN software I am using is Sonicwall Mobile Connect and I'm on OS X El Capitan. I understand that the old NetExtender software does update /etc/resolv.conf; however, there are issues with it on El Cap, so we're stuck with the mobile connect client. |
@btyler97 Thanks for the information. To confirm: this is only happening when you're connected to the VPN? Are you able to use the OpenStack command line tools while you're connected to the VPN? |
@jtopjian here is a link on how dns works with mobile connect. Might help with diagnosing the issue. https://support.software.dell.com/kb/sw11559 |
@pryorda Thanks! At this point, I'm trying to make a confident determination that the issue everyone is seeing is only happening when they are connected to a VPN. If so, then I believe this issue isn't local to just the OpenStack provider, but possibly Terraform core and/or Golang. I think the main reason why this problem is manifesting within the OpenStack provider is because it's one of the few providers within Terraform that communicates with a non-public cloud provider. DNS resolution behavior might be different depending on how the DNS infrastructure that contains the OpenStack endpoint records is configured along with the VPN. The link @pryorda gave, seems to support that theory. |
@jtopjian I can confirm that this is only an issue when connected via the VPN. After some late night research I'm also of the belief that the issue isn't local to the Openstack provider. The Golang docs on the "net" package hint at a possible cause (https://golang.org/pkg/net/) under the "Name Resolution" heading. I tried setting the ENV variables they suggested, but I'm probably doing something wrong as I didn't notice any change. Unfortunately, I just don't have enough familiarity with Go to know if they aren't applicable in this situation or if I'm missing something. |
@jtopjian Here is what we found... The issue is that Mac OS X native net dns resolver goes directly to resolv.conf and our vpn client does not update the resolv.conf since it split tunnels the queries based on dns suffix. We fixed the issue by having it build using this command:
A packet capture confirmed that it was traversing the vpn rather then going directly to the servers in resolv.conf. |
Seems like you need this upstream change to go language networking for this to work as expected: |
We tried that and that doesnt work well with split horizon dns. |
I had mentioned this in passing in #14781, but want to put it here too for posterity: Currently we use Go's native cross-compilation support to build the release binaries for all supported platforms, but that approach doesn't give us the OS-specific libraries and headers needed to use CGo on OS X, and thus we aren't able to use the libc resolver. In future we may be able to use xgo to work around this, but we won't have time to do this in the immediate term, unfortunately. |
Just going to throw my $0.02 in here in case it helps someone else. I currently have a Vault installation sitting in AWS in a VPC using a private Route53 Hosted Zone. This means that the zone is not publicly distributed and can only be accessed within the VPC with which it is associated. To access resources in this VPC I have EC2 instances in the VPC that are used as VPN connectors. I'm running OS X and the VPN software does not update When configuring Terraform's Vault provider I get the |
Not sure what happened, but it looks like this was resolved? I can't replicate this anymore. |
Nothing specific has changed within Terraform itself to support this, but we did switch to Go 1.9 for the latest two releases, so possibly there is some new behavior in Go 1.9 that is making this smoother. I didn't see anything in the release notes specifically about this, but there were some DNS-related changes in the 1.9 timeframe that may have changed the situation here. Versions 0.10.3 and 0.10.4 were built with Go 1.9, while 0.10.2 was built with 1.8. If someone has the time to compare the behavior on 0.10.2 vs. 0.10.4, that could help confirm whether this got resolved by changes in Go 1.9. |
Looks like the Go ticket isn't heading anywhere. We've suffered this same problem on Vault as well. Wouldn't it be possible to just build a CGO-enabled binary using the Travis macOS environment? https://docs.travis-ci.com/user/reference/osx/ |
I understand that there are benefits with Go's resolver. |
Adding some more fuel to this fire. On macOS Mojave ( With these debug options... export TF_LOG=TRACE
export GODEBUG=netdns=cgo+1 ... in the shell environment, the
This issue should probably be renamed as its quite clear by now that this is not a VPN related issue. This is as simple as macOS + ( go without cgo ) = DNS issues in some cases. The linked upstream issues in the core go project tracker do not indicate this is a priority for them and I don't really blame them as it appears to be relatively easy for affected projects to work around by using cgo as part of their macOS builds. Unfortunately ( because an upstream fix would be the best outcome ) It looks like it will be necessary for hashicorp to make this workaround part of their build process somehow if we want this fix to happen in a timely manner. |
Any recent thoughts on this? I know it isn't a Hashicorp bug per-se, but more driven by what Go is doing behind the scenes - yet in TF v0.14.5 it's still causing pain. Perhaps I missed it in the thread above, but modifying
However, you can add resolv.conf-like files to Short of recompiling TF (which I don't entirely understand) the only work-arounds I can think of are modifying your local |
If you are using unbound with your pi-hole, you can also setup the vpn zones there as well. |
That's a good thought, but in practice it didn't work. I think that's because the VPN connection is on my host, but not on the pihole/unbound server. This means that the unbound server has no access to the internal DNS servers which are behind the VPN. |
On Mac OS, I have a script for my vpn and while it's not pretty, this is a script portion that allows me to workaround any Hashicorp (go) tools dns issues: # you can replace "Wi-Fi" with "Ethernet" if using that
networksetup -setdnsservers Wi-Fi empty
networksetup -setdnsservers Wi-Fi [dns-server]
killall -HUP mDNSResponder |
Hi all- We're actively working to fix this issue across Terraform Core and the Providers. For those of you who are still facing issues and are willing to test out our solution and provide feedback, please email [email protected] with the version of the CLI you're using, and the names and versions of the providers you're using. Thanks! |
Hello, Terraform v1.0.1 has been released, which includes a natively compiled build for MacOS darwin/amd64. This should avoid the above DNS issues on that platform. If there is still a reproducible issue with DNS resolution over a vpn with v1.0.1 on that platform, please feel free to reply here and we can reevaluate. Thanks! |
I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. |
Using 0.6.3:
I upgraded to 0.6.4, ran with same Openstack env vars and:
The text was updated successfully, but these errors were encountered: