I want to be able to run coredns on both UDP and TCP port 53. How can do I do that with my fly.toml? I have this currently, but it seems to be listening on TCP only:
This should work, but the configuration is a little persnickity.
Can you show us your CoreDNS config? In particular, which IP are you binding to? UDP responses have to come from the fly-global-services IP. That hostname is defined in /etc/hosts. Some libraries that bind to 0.0.0.0 don’t return packets from the right IP, they use the first IP configured on the interface. It’s possible UDP DNS isn’t working for this reason. More details here: UDP reply from unexpected source - #4 by conblem
; <<>> DiG 9.10.6 <<>> 192-168-1-1.bbb4173bbf21.u.channelsdvr.net @213.188.216.24
;; global options: +cmd
;; connection timed out; no servers could be reached
; <<>> DiG 9.10.6 <<>> 192-168-1-1.bbb4173bbf21.u.channelsdvr.net @213.188.214.67
;; global options: +cmd
;; connection timed out; no servers could be reached
We think there’s a bug that keeps old VMs in our edge UDP mappings after they’ve gone away. This means that UDP packets are getting sent to now dead VMs based on sort order. This is definitely something we can fix.
I think your deploy actually fixed it, believe it or not. We’re going to track down this bug, but if you experience it again try doing this:
Run fly status to get a list of VMs. Then run fly vm stop <id> on any of them. There’s some kind of stale data that a deploy seems to flush, stopping a VM could have the same effect.