DNS global override not used on MacOS and iOS

Tailscale version is 1.40.0 for both the MacOS and iOS devices.
MacOS Ventura 13.4 and iOS 16.5

One weird behaviour that I noticed is that the DNS queries went to my custom DNS server (configured as global override in the Tailscale admin) for the first few seconds when I installed Tailscale and enabled it. After that, it stopped working. Is anyone else facing similar issues?