Could not lookup srv records

I have Cloudflare Tunnel properly set but I keep getting this error

~/.cloudflared $ cloudflared tunnel run score
2022-12-30T10:30:31Z INF Starting tunnel tunnelID=a7de280f-1f19-4412-9e53-58199566bd57
2022-12-30T10:30:31Z INF Version 2022.12.1
2022-12-30T10:30:31Z INF GOOS: android, GOVersion: go1.19.4, GoArch: arm64
2022-12-30T10:30:31Z INF Settings: map[cred-file:a7de280f-1f19-4412-9e53-58199566bd57.json credentials-file:a7de280f-1f19-4412-9e53-58199566bd57.json url:http://localhost:7000]
2022-12-30T10:30:31Z INF cloudflared will not automatically update when run from the shell. To enable auto-updates, run cloudflared as a service: https://developers.cloudflare.com/cloudflare-one/connections/connect-apps/run-tunnel/as-a-service/ 2022-12-30T10:30:31Z INF Generated Connector ID: e4d9acda-b469-4873-8654-826c7c91e0ae 2022-12-30T10:30:31Z ERR Unable to lookup protocol. Defaulting to http2. If this fails, you can attempt --protocol quic instead. error=“lookup protocol-v2.argotunnel.com on [::1]:53: read udp [::1]:42729->[::1]:53: read: connection refused” 2022-12-30T10:30:31Z INF Initial protocol http2
2022-12-30T10:30:31Z INF ICMP proxy will use 192.168.43.193 as source for IPv4
2022-12-30T10:30:31Z INF ICMP proxy will use fe80::227:15ff:feaf:2161 in zone wlan0 as source for IPv6
2022-12-30T10:30:31Z WRN ICMP proxy feature is disabled error=“cannot create ICMPv4 proxy: bind: permission denied nor ICMPv6 proxy: bind: permission denied”
2022-12-30T10:30:31Z INF Starting metrics server on 127.0.0.1:42179/metrics 2022-12-30T10:30:32Z ERR update check failed error=“no release found”
2022-12-30T10:30:46Z ERR Error looking up Cloudflare edge IPs: the DNS query failed error=“lookup _v2-origintunneld._tcp.argotunnel.com on [::1]:53: read udp [::1]:49493->[::1]:53: read: connection refused” 2022-12-30T10:30:46Z ERR Please try the following things to diagnose this issue: 2022-12-30T10:30:46Z ERR 1. ensure that argotunnel.com is returning “origintunneld” service records.
2022-12-30T10:30:46Z ERR Run your system’s equivalent of: dig srv _origintunneld._tcp.argotunnel.com 2022-12-30T10:30:46Z ERR 2. ensure that your DNS resolver is not returning compressed SRV records. 2022-12-30T10:30:46Z ERR See GitHub issue net: go 1.11 DNS client incompatible with SRV records from kube-dns · Issue #27546 · golang/go · GitHub
2022-12-30T10:30:46Z ERR For example, you could use Cloudflare’s 1.1.1.1 as your resolver:
2022-12-30T10:30:46Z ERR Set up Cloudflare 1.1.1.1 resolver · Cloudflare 1.1.1.1 docs
2022-12-30T10:30:46Z INF Tunnel server stopped
2022-12-30T10:30:46Z ERR Initiating shutdown error=“Could not lookup srv records on _v2-origintunneld._tcp.argotunnel.com: lookup _v2-origintunneld._tcp.argotunnel.com on [::1]:53: read udp [::1]:49493->[::1]:53: read: connection refused”
2022-12-30T10:30:46Z INF Metrics server stopped
Could not lookup srv records on _v2-origintunneld._tcp.argotunnel.com: lookup _v2-origintunneld._tcp.argotunnel.com on [::1]:53: read udp [::1]:49493->[::1]:53: read: connection refused

What is the problem?

Could you please repost the error in a code block by surrounding it with backticks

```
like this
```
so that is it properly formatted

like this

I have Cloudflare Tunnel properly set by I keep getting this error

2022-12-30T10:47:14Z INF Starting tunnel tunnelID=a7de280f-1f19-4412-9e53-58199566bd57
2022-12-30T10:47:14Z INF Version 2022.12.1
2022-12-30T10:47:14Z INF GOOS: android, GOVersion: go1.19.4, GoArch: arm64
2022-12-30T10:47:14Z INF Settings: map[cred-file:a7de280f-1f19-4412-9e53-58199566bd57.json credentials-file:a7de280f-1f19-4412-9e53-58199566bd57.json url:http://localhost:7000]
2022-12-30T10:47:14Z INF Generated Connector ID: 5be376ee-e0d7-4181-9171-49f9c18d01e7
2022-12-30T10:47:14Z INF cloudflared will not automatically update when run from the shell. To enable auto-updates, run cloudflared as a service: https://developers.cloudflare.com/cloudflare-one/connections/connect-apps/run-tunnel/as-a-service/                                                                                2022-12-30T10:47:14Z ERR Unable to lookup protocol. Defaulting to `http2`. If this fails, you can attempt `--protocol quic` instead. error="lookup protocol-v2.argotunnel.com on [::1]:53: read udp [::1]:40236->[::1]:53: read: connection refused"                                                                                2022-12-30T10:47:14Z INF Initial protocol http2
2022-12-30T10:47:14Z INF ICMP proxy will use 192.168.43.193 as source for IPv4
2022-12-30T10:47:14Z INF ICMP proxy will use fe80::227:15ff:feaf:2161 in zone wlan0 as source for IPv6
2022-12-30T10:47:14Z WRN ICMP proxy feature is disabled error="cannot create ICMPv4 proxy: bind: permission denied nor ICMPv6 proxy: bind: permission denied"
2022-12-30T10:47:14Z INF Starting metrics server on 127.0.0.1:37816/metrics
2022-12-30T10:47:15Z ERR update check failed error="no release found"
2022-12-30T10:47:29Z ERR Error looking up Cloudflare edge IPs: the DNS query failed error="lookup _v2-origintunneld._tcp.argotunnel.com on [::1]:53: read udp [::1]:55805->[::1]:53: read: connection refused"
2022-12-30T10:47:29Z ERR Please try the following things to diagnose this issue:
2022-12-30T10:47:29Z ERR   1. ensure that argotunnel.com is returning "origintunneld" service records.
2022-12-30T10:47:29Z ERR      Run your system's equivalent of: dig srv _origintunneld._tcp.argotunnel.com
2022-12-30T10:47:29Z ERR   2. ensure that your DNS resolver is not returning compressed SRV records.
2022-12-30T10:47:29Z ERR      See GitHub issue https://github.com/golang/go/issues/27546
2022-12-30T10:47:29Z ERR      For example, you could use Cloudflare's 1.1.1.1 as your resolver:
2022-12-30T10:47:29Z ERR      https://developers.cloudflare.com/1.1.1.1/setting-up-1.1.1.1/
2022-12-30T10:47:29Z INF Tunnel server stopped
2022-12-30T10:47:29Z ERR Initiating shutdown error="Could not lookup srv records on _v2-origintunneld._tcp.argotunnel.com: lookup _v2-origintunneld._tcp.argotunnel.com on [::1]:53: read udp [::1]:55805->[::1]:53: read: connection refused"
2022-12-30T10:47:29Z INF Metrics server stopped
Could not lookup srv records on _v2-origintunneld._tcp.argotunnel.com: lookup _v2-origintunneld._tcp.argotunnel.com on [::1]:53: read udp [::1]:55805->[::1]:53: read: connection refused

What is wrong?

It looks like cloudflared is trying to make a DNS query to the local DNS resolver, but the connection is being refused.

What is the exact command you are executing to start cloudflared?

cloudflared tunnel run score (score is the tunne name)

  1. cloudflared tunnel login (cert.pem)
  2. cloudflared tunnel create score (tunnel)
  3. creating config.yml file
  4. cloudflared tunnel route dns www.
  5. cloudflared tunnel route dns www.
  6. cloudflared tunnel run score

This process has worked in the past but its challanging

This looks like an issue with your local DNS resolver. Could you please try running the following commands and provide us the output?

dig example.com
dig @127.0.0.1 example.com
dig @::1 example.com

dig SRV _v2-origintunneld._tcp.argotunnel.com
dig @127.0.0.1 SRV _v2-origintunneld._tcp.argotunnel.com
dig @::1 SRV _v2-origintunneld._tcp.argotunnel.com

Hi,

I am having the same problem.

Running the dig command produces this output:

dig SRV _v2-origintunneld._tcp.argotunnel.com
; <<>> DiG 9.18.11 <<>> SRV _v2-origintunneld._tcp.argotunnel.com

;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 33892
;; flags: qr rd ra; QUERY: 1, ANSWER: 2, AUTHORITY: 0, ADDITIONAL: 1

;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 1232
;; QUESTION SECTION:

;_v2-origintunneld._tcp.argotunnel.com. IN SRV

;; ANSWER SECTION:

_v2-origintunneld._tcp.argotunnel.com. 269 IN SRV 2 1 7844 region2.v2.argotunnel.com.
_v2-origintunneld._tcp.argotunnel.com. 269 IN SRV 1 1 7844 region1.v2.argotunnel.com.

;; Query time: 9 msec
;; SERVER: 127.0.0.1#53(127.0.0.1) (UDP)
;; WHEN: Tue Mar 14 12:45:44 +08 2023
;; MSG SIZE rcvd: 156

dig @127.0.0.1 SRV _v2-origintunneld._tcp.'argotunnel.com'
; <<>> DiG 9.18.11 <<>> @127.0.0.1 SRV _v2-origintunneld._tcp.argotunnel.com

; (1 server found)
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 20283
;; flags: qr rd ra; QUERY: 1, ANSWER: 2, AUTHORITY: 0, ADDITIONAL: 1

;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 1232
;; QUESTION SECTION:

;_v2-origintunneld._tcp.argotunnel.com. IN SRV

;; ANSWER SECTION:

_v2-origintunneld._tcp.argotunnel.com. 300 IN SRV 2 1 7844 region2.v2.argotunnel.com.
_v2-origintunneld._tcp.argotunnel.com. 300 IN SRV 1 1 7844 region1.v2.argotunnel.com.

;; Query time: 9 msec
;; SERVER: 127.0.0.1#53(127.0.0.1) (UDP)
;; WHEN: Tue Mar 14 12:50:35 +08 2023
;; MSG SIZE rcvd: 156

dig @::1 SRV _v2-origintunneld._tcp.argotunnel.com
; <<>> DiG 9.18.11 <<>> @::1 SRV _v2-origintunneld._tcp.argotunnel.com

; (1 server found)
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 34256
;; flags: qr rd ra; QUERY: 1, ANSWER: 2, AUTHORITY: 0, ADDITIONAL: 1

;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 1232
;; QUESTION SECTION:

;_v2-origintunneld._tcp.argotunnel.com. IN SRV

;; ANSWER SECTION:

_v2-origintunneld._tcp.argotunnel.com. 203 IN SRV 1 1 7844 region1.v2.argotunnel.com.
_v2-origintunneld._tcp.argotunnel.com. 203 IN SRV 2 1 7844 region2.v2.argotunnel.com.

;; Query time: 0 msec
;; SERVER: ::1#53(::1) (UDP)
;; WHEN: Tue Mar 14 12:52:12 +08 2023
;; MSG SIZE rcvd: 156

Thank you.