cli icon indicating copy to clipboard operation
cli copied to clipboard

"cf api" fails if the 1st nameserver fails to resolve the endpoint

Open cdlliuy opened this issue 10 years ago • 38 comments

Condition: Several name servers are defined in /etc/resolv.conf: nameserver "internal" nameserver "public" Then, the "api endpoint" is accessible from nameserver "public", but not from nameserver "internal".

In this situation, I can 1 . ping "api endpoint" successfully,
2. curl "api endpoint"/v2/info successfully 3. nslookup "api endpoint" successfully nslookup "api endpoint" ;; Got recursion not available from "internal", trying next server Server: "public" Address: "public"#53 Non-authoritative answer: Name: "api endpoint" Address: "ip address of api endpoint" 4. But failed with "cf api" cmd: [exec] Setting api endpoint to https://"api endpoint" ... [exec] FAILED [exec] Error performing request: Get https://"api endpoint" /v2/info: dial tcp: lookup "api endpoint" on "internal":53: no such host

It looks like "cf api" cmd only check the 1st nameserver, and fails to do recursive lookup as nslookup, curl, ping and etc system cmd.

cdlliuy avatar Feb 16 '16 02:02 cdlliuy

We have created an issue in Pivotal Tracker to manage this. You can view the current status of your issue at: https://www.pivotaltracker.com/story/show/113792769.

cf-gitbot avatar Feb 16 '16 02:02 cf-gitbot

Hi @cdlliuy,

If you change the Go resolver, does it make a difference? GODEBUG=netdns=cgo cf api https://api endpoint

dkoper avatar Feb 16 '16 10:02 dkoper

hi, @dkoper , it works with GODEBUG=netdns=cgo cf api https://api endpoint, but when I do "cf login", I must "GODEBUG=netdns=cgo cf login -a https://api.xxx" , and the further request must be works with "GODEBUG=netdns=cgo" as well, i.e. "GODEBUG=netdns=cgo cf apps".

I think this is a workaround, right?

cdlliuy avatar Feb 17 '16 01:02 cdlliuy

Hi @cdlliuy, Thanks for getting back to me so quickly. The CLI is implemented in Golang, which defaults to a DNS resolver that doesn't seem to cater for your use case. Setting the environment variable makes it use a non-default DNS resolver that does cater for your use case. The CLI team will need to investigate the impact of changing the CLI to use the other resolver by default.

In the meantime, you can set GODEBUG=netdns=cgo as a global environment variable in your shell so cf (and other programs developed in Golang that likely weren't able to resolve external addresses either) will work.

Regards, Dies Koper CF CLI PM

dkoper avatar Feb 17 '16 01:02 dkoper

Got it. Thanks Dies

cdlliuy avatar Feb 17 '16 01:02 cdlliuy

Hi @dkoper

Oh yes, the issue we're facing is the same. But without setting GODEBUG=netdns=cgo for v6.15.0 it works fine. So v6.16.x doesn't work with this flag.

rahulkj avatar Mar 09 '16 12:03 rahulkj

Possibly related, we noticed that cf v6.16 does not handle a misconfigured /etc/resolv.conf on linux well. Because of the hard-coded 5 second timeout when configuring net.Dial, if the DNS resolution takes longer than 5 seconds, the CLI will exit with error. I created https://www.pivotaltracker.com/story/show/115252237 to address this.

We saw the above behavior on a bosh-deployed 64-bit linux VM (for cf-smoke-tests) that had a bad entry in /etc/resolv.conf but could not reproduce this on OSX. Possibly related to the fact that the linux 64-bit CLI is dynamically-linked and all other binaries are statically-linked.

We have also had similar reports from the CF community in the last week or so (see https://github.com/cloudfoundry/cf-release/issues/923).

robdimsdale avatar Mar 09 '16 20:03 robdimsdale

@cdlliuy we were unable to reproduce this on Ubuntu Trusty 64-bit or Wily 64-bit, using CLI 6.15.0, 6.16.0 or 6.16.1.

Can you tell us more about your system?

You can see our attempt to reproduce below:

$ cat /etc/resolv.conf 
nameserver 127.0.0.1
nameserver 10.0.2.3

$ nslookup api.run.pivotal.io 127.0.0.1
Server:     127.0.0.1
Address:    127.0.0.1#53

** server can't find api.run.pivotal.io: REFUSED

$ nslookup api.run.pivotal.io
;; Got recursion not available from 127.0.0.1, trying next server
Server:     10.0.2.3
Address:    10.0.2.3#53

Non-authoritative answer:
Name:   api.run.pivotal.io
Address: 54.236.99.215
Name:   api.run.pivotal.io
Address: 54.175.152.201

$ cf api api.run.pivotal.io
Setting api endpoint to api.run.pivotal.io...
OK


API endpoint:   https://api.run.pivotal.io (API version: 2.51.0)   
Not logged in. Use 'cf login' to log in.

Setting GODEBUG=netdns=go or GODEBUG=netdns=cgo did not change the result.

cbguder avatar Mar 15 '16 00:03 cbguder

@cbguder, the problem happens on 6.13.0-e68ce0f-2015-10-15T22:53:58+00:00, and I don't have permission to change the cf version of the target env. I contact the admin and check whether v6.16.1 works

cdlliuy avatar Mar 22 '16 06:03 cdlliuy

$ cf --version cf version 6.16.1+924508c-2016-02-26

I installed cf-cli through brew installer, and the version was the 6.16.1 with the version, I was continually gettting the error message as follows.

$ cf api https://api.run.pivotal.io

Error performing request: Get https://login.run.pivotal.io/login: dial tcp: i/o timeout
TIP: If you are behind a firewall and require an HTTP proxy, verify the https_proxy environment variable is correctly set. Else, check your network connection.

even with GODEBUG=netdns=go and GODEBUG=netdns=cgo option, it failed.

But when i reinstall cf-cli version 6.15.0, it works. I guess there is some issue on the latest version.

By the way, my local pc can look up the DNS nameserver.

$ nslookup api.run.pivotal.io
Server:     203.235.210.107
Address:    203.235.210.107#53

Non-authoritative answer:
Name:   api.run.pivotal.io
Address: 54.236.99.215
Name:   api.run.pivotal.io
Address: 54.175.152.201

SimyungYang avatar Apr 04 '16 06:04 SimyungYang

We face the same issue when trying to execute the following command:

$ cf install-plugin Diego-Enabler -r CF-Community -f Looking up 'Diego-Enabler' from repository 'CF-Community' FAILED Error getting plugin metadata from repo: Error requesting from 'CF-Community' - Get http://plugins.cloudfoundry.org/list: dial tcp: lookup plugins.cloudfoundry.org on first_dns_server:53: n o such host

Have tried with CF cli 6.16.1 and 6.15.0 on Ubuntu 14.04.4, 3.13.0-63-generic. It worked only with GODEBUG=netdns=cgo enabled on both versions and failed with GODEBUG=netdns=go.

vvraskin avatar Apr 05 '16 15:04 vvraskin

@cdlliuy @vvraskin

We have released cf CLI 6.18.0 with changes that may affect its behaviour in circumstances such as the ones you have described. Would you mind trying it out and report back how it works without the environment variables, and with?

Cheers, Dies Koper CF CLI PM

dkoper avatar May 11 '16 06:05 dkoper

@dkoper Hello,

I've checked the latest version of cf CLI (6.18.1+a1103f0-2016-05-24) and I still see similar problems.

Command:

CF_TRACE=true ./cf api api.fabric.ng.mydomain.net

Output:

Setting api endpoint to api.fabric.ng.mydomain.net...

REQUEST: [2016-06-01T02:08:44-05:00]
GET /v2/info HTTP/1.1
Host: api.fabric.ng.mydomain.net
Accept: application/json
Content-Type: application/json
User-Agent: go-cli 6.18.1+a1103f0 / linux


fatal error: unexpected signal during runtime execution
[signal 0xb code=0x1 addr=0x63 pc=0x7fc851a0db2c]

runtime stack:
runtime.throw(0xf62a20, 0x2a)
    /usr/local/go/src/runtime/panic.go:547 +0x90
runtime.sigpanic()
    /usr/local/go/src/runtime/sigpanic_unix.go:12 +0x5a

goroutine 810 [syscall, locked to thread]:
runtime.cgocall(0xafdea0, 0xc820036bd8, 0x0)
    /usr/local/go/src/runtime/cgocall.go:123 +0x11b fp=0xc820036b78 sp=0xc820036b48
net._C2func_getaddrinfo(0x7fc8440008c0, 0x0, 0xc82042e2d0, 0xc8200740c0, 0x0, 0x0, 0x0)
    ??:0 +0x55 fp=0xc820036bd8 sp=0xc820036b78
net.cgoLookupIPCNAME(0xc8204fe1e0, 0x19, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x101f800)
    /usr/local/go/src/net/cgo_unix.go:111 +0x448 fp=0xc820036d50 sp=0xc820036bd8
net.cgoLookupIP(0xc8204fe1e0, 0x19, 0x0, 0x0, 0x0, 0x0, 0x0, 0x409f45)
    /usr/local/go/src/net/cgo_unix.go:163 +0x56 fp=0xc820036da8 sp=0xc820036d50
net.lookupIP(0xc8204fe1e0, 0x19, 0x0, 0x0, 0x0, 0x0, 0x0)
    /usr/local/go/src/net/lookup_unix.go:67 +0x94 fp=0xc820036e18 sp=0xc820036da8
net.glob.func16(0x101f828, 0xc8204fe1e0, 0x19, 0x0, 0x0, 0x0, 0x0, 0x0)
    /usr/local/go/src/net/hook.go:10 +0x4d fp=0xc820036e58 sp=0xc820036e18
net.lookupIPDeadline.func1(0x0, 0x0, 0x0, 0x0)
    /usr/local/go/src/net/lookup.go:106 +0x71 fp=0xc820036ed8 sp=0xc820036e58
internal/singleflight.(*Group).doCall(0x15ec1c0, 0xc82050a140, 0xc8204fe1e0, 0x19, 0xc8204fe260)
    /usr/local/go/src/internal/singleflight/singleflight.go:93 +0x2c fp=0xc820036f88 sp=0xc820036ed8
runtime.goexit()
    /usr/local/go/src/runtime/asm_amd64.s:1998 +0x1 fp=0xc820036f90 sp=0xc820036f88
created by internal/singleflight.(*Group).DoChan
    /usr/local/go/src/internal/singleflight/singleflight.go:86 +0x3ee

goroutine 1 [select]:
net/http.(*Transport).getConn(0xc8201fc000, 0xc8203f0000, 0x0, 0xc820430900, 0x5, 0xc8204fe1e0, 0x1d, 0x0, 0x0, 0x0)
    /usr/local/go/src/net/http/transport.go:711 +0x4ef
net/http.(*Transport).RoundTrip(0xc8201fc000, 0xc8203f0000, 0xc8201fc000, 0x0, 0x0)
    /usr/local/go/src/net/http/transport.go:311 +0x7e9
net/http.send(0xc8203f0000, 0x7fc852d84598, 0xc8201fc000, 0x0, 0x0, 0x0, 0xc82042e210, 0x0, 0x0)
    /usr/local/go/src/net/http/client.go:260 +0x6b7
net/http.(*Client).send(0xc820430960, 0xc8203f0000, 0x0, 0x0, 0x0, 0xc820228e74, 0x0, 0x0)
    /usr/local/go/src/net/http/client.go:155 +0x185
net/http.(*Client).doFollowingRedirects(0xc820430960, 0xc8203f0000, 0x101fa50, 0x0, 0x0, 0x0)
    /usr/local/go/src/net/http/client.go:475 +0x8a4
net/http.(*Client).Do(0xc820430960, 0xc8203f0000, 0x0, 0x0, 0x0)
    /usr/local/go/src/net/http/client.go:188 +0xff
github.com/cloudfoundry/cli/cf/net.Gateway.doRequest(0x7fc852d954a8, 0xc8200e4fd0, 0x101ea38, 0x1, 0x12a05f200, 0x0, 0x0, 0x0, 0x7fc852d95068, 0xc8204324b0, ...)
    /tmp/build/80754af9/gopath/src/github.com/cloudfoundry/cli/cf/net/gateway.go:432 +0x144
github.com/cloudfoundry/cli/cf/net.Gateway.doRequestAndHandlerError(0x7fc852d954a8, 0xc8200e4fd0, 0x101ea38, 0x1, 0x12a05f200, 0x0, 0x0, 0x0, 0x7fc852d95068, 0xc8204324b0, ...)
    /tmp/build/80754af9/gopath/src/github.com/cloudfoundry/cli/cf/net/gateway.go:404 +0x5e
github.com/cloudfoundry/cli/cf/net.Gateway.doRequestHandlingAuth(0x7fc852d954a8, 0xc8200e4fd0, 0x101ea38, 0x1, 0x12a05f200, 0x0, 0x0, 0x0, 0x7fc852d95068, 0xc8204324b0, ...)
    /tmp/build/80754af9/gopath/src/github.com/cloudfoundry/cli/cf/net/gateway.go:375 +0x190
github.com/cloudfoundry/cli/cf/net.Gateway.performRequestForResponseBytes(0x7fc852d954a8, 0xc8200e4fd0, 0x101ea38, 0x1, 0x12a05f200, 0x0, 0x0, 0x0, 0x7fc852d95068, 0xc8204324b0, ...)
    /tmp/build/80754af9/gopath/src/github.com/cloudfoundry/cli/cf/net/gateway.go:254 +0x8d
github.com/cloudfoundry/cli/cf/net.Gateway.PerformRequestForJSONResponse(0x7fc852d954a8, 0xc8200e4fd0, 0x101ea38, 0x1, 0x12a05f200, 0x0, 0x0, 0x0, 0x7fc852d95068, 0xc8204324b0, ...)
    /tmp/build/80754af9/gopath/src/github.com/cloudfoundry/cli/cf/net/gateway.go:274 +0x9a
github.com/cloudfoundry/cli/cf/net.Gateway.GetResource(0x7fc852d954a8, 0xc8200e4fd0, 0x101ea38, 0x1, 0x12a05f200, 0x0, 0x0, 0x0, 0x7fc852d95068, 0xc8204324b0, ...)
    /tmp/build/80754af9/gopath/src/github.com/cloudfoundry/cli/cf/net/gateway.go:102 +0x160
github.com/cloudfoundry/cli/cf/api.RemoteInfoRepository.getCCAPIInfo(0x7fc852d954a8, 0xc8200e4fd0, 0x101ea38, 0x1, 0x12a05f200, 0x0, 0x0, 0x0, 0x7fc852d95068, 0xc8204324b0, ...)
    /tmp/build/80754af9/gopath/src/github.com/cloudfoundry/cli/cf/api/endpoints.go:51 +0x12c
github.com/cloudfoundry/cli/cf/api.RemoteInfoRepository.GetCCInfo(0x7fc852d954a8, 0xc8200e4fd0, 0x101ea38, 0x1, 0x12a05f200, 0x0, 0x0, 0x0, 0x7fc852d95068, 0xc8204324b0, ...)
    /tmp/build/80754af9/gopath/src/github.com/cloudfoundry/cli/cf/api/endpoints.go:33 +0x20e
github.com/cloudfoundry/cli/cf/api.(*RemoteInfoRepository).GetCCInfo(0xc8201f1320, 0x7ffc587265f0, 0x19, 0x40000000, 0x0, 0x0, 0x0, 0x0)
    <autogenerated>:31 +0xf1
github.com/cloudfoundry/cli/cf/configuration/coreconfig.APIConfigRefresher.Refresh(0x7fc852d956b8, 0xc8201f1320, 0x7fc852d95170, 0xc8204324b0, 0x7ffc587265f0, 0x19, 0x0, 0x0, 0x0, 0x0)
    /tmp/build/80754af9/gopath/src/github.com/cloudfoundry/cli/cf/configuration/coreconfig/api_config_refresher.go:24 +0x88
github.com/cloudfoundry/cli/cf/commands.Api.setAPIEndpoint(0x7fc852d94ed0, 0xc820434040, 0x7fc852d956b8, 0xc8201f1320, 0x7fc852d95170, 0xc8204324b0, 0x7ffc587265f0, 0x19, 0x0, 0xe54758, ...)
    /tmp/build/80754af9/gopath/src/github.com/cloudfoundry/cli/cf/commands/api.go:97 +0x307
github.com/cloudfoundry/cli/cf/commands.Api.Execute(0x7fc852d94ed0, 0xc820434040, 0x7fc852d956b8, 0xc8201f1320, 0x7fc852d95170, 0xc8204324b0, 0x7fc852d98b88, 0xc82041e340)
    /tmp/build/80754af9/gopath/src/github.com/cloudfoundry/cli/cf/commands/api.go:76 +0xc09
github.com/cloudfoundry/cli/cf/commands.(*Api).Execute(0xc8204302a0, 0x7fc852d98b88, 0xc82041e340)
    <autogenerated>:4 +0xaa
main.main()
    /tmp/build/80754af9/gopath/src/github.com/cloudfoundry/cli/main/main.go:118 +0x1782

goroutine 17 [syscall, locked to thread]:
runtime.goexit()
    /usr/local/go/src/runtime/asm_amd64.s:1998 +0x1

goroutine 20 [syscall]:
os/signal.signal_recv(0x0)
    /usr/local/go/src/runtime/sigqueue.go:116 +0x132
os/signal.loop()
    /usr/local/go/src/os/signal/signal_unix.go:22 +0x18
created by os/signal.init.1
    /usr/local/go/src/os/signal/signal_unix.go:28 +0x37

goroutine 809 [select]:
net.lookupIPDeadline(0xc8204fe1e0, 0x19, 0xecee08101, 0x73cb5dc, 0x15ed2a0, 0x0, 0x0, 0x0, 0x0, 0x0)
    /usr/local/go/src/net/lookup.go:109 +0x6a6
net.internetAddrList(0xe59db0, 0x3, 0xc8204fe1e0, 0x1d, 0xecee08101, 0x73cb5dc, 0x15ed2a0, 0x0, 0x0, 0x0, ...)
    /usr/local/go/src/net/ipsock.go:252 +0x6ee
net.resolveAddrList(0xe55650, 0x4, 0xe59db0, 0x3, 0xc8204fe1e0, 0x1d, 0xecee08101, 0x73cb5dc, 0x15ed2a0, 0x0, ...)
    /usr/local/go/src/net/dial.go:158 +0x466
net.(*Dialer).Dial(0xc8201162d0, 0xe59db0, 0x3, 0xc8204fe1e0, 0x1d, 0x0, 0x0, 0x0, 0x0)
    /usr/local/go/src/net/dial.go:216 +0x124
net.(*Dialer).Dial-fm(0xe59db0, 0x3, 0xc8204fe1e0, 0x1d, 0x0, 0x0, 0x0, 0x0)
    /tmp/build/80754af9/gopath/src/github.com/cloudfoundry/cli/cf/net/gateway.go:458 +0x6e
net/http.(*Transport).dial(0xc8201fc000, 0xe59db0, 0x3, 0xc8204fe1e0, 0x1d, 0x0, 0x0, 0x0, 0x0)
    /usr/local/go/src/net/http/transport.go:659 +0x96
net/http.(*Transport).dialConn(0xc8201fc000, 0x0, 0xc820430900, 0x5, 0xc8204fe1e0, 0x1d, 0xc82005fc80, 0x0, 0x0)
    /usr/local/go/src/net/http/transport.go:762 +0x1e3d
net/http.(*Transport).getConn.func4(0xc8201fc000, 0x0, 0xc820430900, 0x5, 0xc8204fe1e0, 0x1d, 0xc8203c64e0)
    /usr/local/go/src/net/http/transport.go:706 +0x66
created by net/http.(*Transport).getConn
    /usr/local/go/src/net/http/transport.go:708 +0x262`

Command:

CF_TRACE=true GODEBUG=netdns=go ./cf api.fabric.ng.mydomain.net

Output:

root@boshcli:~# CF_TRACE=true GODEBUG=netdns=go ./cf api api.fabric.ng.mydomain.net
Setting api endpoint to api.fabric.ng.mydomain.net...

REQUEST: [2016-06-01T02:03:54-05:00]
GET /v2/info HTTP/1.1
Host: api.fabric.ng.mydomain.net
Accept: application/json
Content-Type: application/json
User-Agent: go-cli 6.18.1+a1103f0 / linux



REQUEST: [2016-06-01T02:03:54-05:00]
GET /v2/info HTTP/1.1
Host: api.fabric.ng.mydomain.net
Accept: application/json
Content-Type: application/json
User-Agent: go-cli 6.18.1+a1103f0 / linux


FAILED
Error performing request: Get http://api.fabric.ng.mydomain.net/v2/info: dial tcp: lookup api.fabric.ng.mydomain.net on 192.155.213.160:53: no such host
TIP: If you are behind a firewall and require an HTTP proxy, verify the https_proxy environment variable is correctly set. Else, check your network connection.

I have following DNS configuration in /etc/resolv.conf: nameserver 127.0.0.1 # Consul DNS nameserver 192.155.213.160 # powerDNS nameserver 10.0.80.12 # Softlayer DNS The address I'm trying to resolve (http://api.fabric.ng.mydomain.net) is located on the Softlayer DNS. nslookup and ping can resolve it, but dig is failing. However, when I try to comment out the powerDNS entry in /etc/resolv.conf, dig is working, but cf api is showing the error. So I think that the problem is that cf client still cannot iterate over all DNS entries in /etc/resolv.conf.

vvraskin avatar Jun 01 '16 07:06 vvraskin

Hello

i'm using the latest cf version 6.19.0+b29b4e0-2016-06-08 and keep getting the same message. if i tether laptop to my phone, i can login, push applications, but soon as i am connected to my home wireless... i get the following errors when i try to do "cf login, cf push , etc"

auth request failed: Error performing request: Post https://login.run.pivotal.io/oauth/token: dial tcp: i/o timeout TIP: If you are behind a firewall and require an HTTP proxy, verify the https_proxy environment variable is correctly set. Else, check your network connection.

umairriaz82 avatar Jun 28 '16 14:06 umairriaz82

@cdlliuy, @umairriaz82, @SimyungYang, @rahulkj Possibly the issue is that the cf CLI has a (hardcoded) 5 sec timeout for resolving the domain name and connecting to the IP address. So if /etc/resolv.conf is configured to switch to the secondary DNS server after 5 seconds (its documented default timeout value), the CLI will already have given up. In cf CLI 6.20.0 we have experimentally replaced the hardcoded value with an environment variable CF_DIAL_TIMEOUT to allow you to override the 5 sec timeout. Please let us know how that works out for you.

@vvraskin If you can reproduce the panic with cf CLI 6.20.0, please submit a new issue and we'll take a look.

Cheers, Dies Koper CF CLI PM

dkoper avatar Jun 30 '16 00:06 dkoper

There is a feeling that cf cli makes a DNS request for every connection to API and does not reuse already resolved name. This feeling comes from cf being slow if when dns is slow.

giner avatar Jun 30 '16 02:06 giner

@giner I believe the idea was that the connection would be reused for subsequent API calls, so there would be no need to cache resolved addresses (a process which leave to golang, which doesn't seem to come with a cache itself). As part of another investigation we recently found out that we're not reusing connections. I was about to create a story for that. Feel free to create a new GitHub issue for that to make it easier for you to track.

Regards, Dies Koper CF CLI PM

dkoper avatar Jul 22 '16 23:07 dkoper

@dkoper, with the cf cli "cf version 6.19.0+b29b4e0-2016-06-08" , the workaround "export GODEBUG=netdns=cgo" can't work anymore . Here is the cmd & response I got

:~$ cf -v cf version 6.19.0+b29b4e0-2016-06-08 :~$ export GODEBUG=netdns=cgo :~$ cf api http://api. Setting api endpoint to http://api.... FAILED Error performing request: Get http://api./v2/info: dial tcp: lookup api. on 10.117.176.18:53: no such host TIP: If you are behind a firewall and require an HTTP proxy, verify the https_proxy environment variable is correctly set. Else, check your network connection.

In the meanwhile, the ping & nslookup both work:

:~$ ping api. PING (158.85.156.18) 56(84) bytes of data. 64 bytes from 12.9c.559e.ip4.static.sl-reverse.com (158.85.156.18): icmp_seq=1 ttl=185 time=226 ms 64 bytes from 12.9c.559e.ip4.static.sl-reverse.com (158.85.156.18): icmp_seq=2 ttl=185 time=226 ms 64 bytes from 12.9c.559e.ip4.static.sl-reverse.com (158.85.156.18): icmp_seq=3 ttl=185 time=226 ms ^C --- ping statistics --- 3 packets transmitted, 3 received, 0% packet loss, time 2001ms rtt min/avg/max/mdev = 226.650/226.766/226.860/0.087 ms

:~$ nslookup api. ;; Got recursion not available from 10.117.176.18, trying next server Server: 10.0.80.11 Address: 10.0.80.11#53

Non-authoritative answer: api. canonical name = . Name: Address: 158.85.156.18

On another similar env, the "cf version 6.13.0-e68ce0f-2015-10-15T22:53:58+00:00" cli worked with workaround "export GODEBUG=netdns=cgo" .

At this time point, I hope to get the workaround works again

cdlliuy avatar Jul 29 '16 12:07 cdlliuy

@cdlliuy Can you try increasing the dial timeout by setting environment variable CF_DIAL_TIMEOUT (in seconds, defaults to 5) in your shell when running the cf command and report back?

dkoper avatar Jul 30 '16 00:07 dkoper

@dkoper, here you go. You can see I set the timeout to 20, and using "date" to dump the time. But the cf cmd failed almost at one, and didn't wait for 20 seconds at all .

:~$ export GODEBUG=netdns=cgo :~$ cf api https://api. Setting api endpoint to https://api.... FAILED Error performing request: Get https://api./v2/info: dial tcp: lookup api. on 10.117.176.18:53: no such host TIP: If you are behind a firewall and require an HTTP proxy, verify the https_proxy environment variable is correctly set. Else, check your network connection. :~$ export CF_DIAL_TIMEOUT=20 :~$ date Sat Jul 30 03:37:29 CDT 2016 :~$ cf api https://api. Setting api endpoint to https://api.... FAILED Error performing request: Get https://api./v2/info: dial tcp: lookup api. on 10.117.176.18:53: no such host TIP: If you are behind a firewall and require an HTTP proxy, verify the https_proxy environment variable is correctly set. Else, check your network connection. :~$ date Sat Jul 30 03:37:35 CDT 2016

cdlliuy avatar Jul 30 '16 08:07 cdlliuy