Setting up custom DNS on windows

I run Devilbox using Docker Desktop on Windows 10 Pro with the containers running on WSL-2. My laptop has both plug-in ethernet + wifi as well as connecting to the internet using VPN (both Cisco AnyConnect and NordVPN). My connections are shown below.

I’m unclear which of these I need to change in order to setup a custom DNS server, any pointers would be most appreciated

I got this resolved so now auto dns is working so before I bring up devilbox in powershell:

Get-Process -Id (Get-NetTCPConnection -LocalPort 53).OwningProcess
Get-NetTCPConnection: No MSFT_NetTCPConnection objects found with property ‘LocalPort’ equal to ‘53’. Verify the value of the property and retry.
Get-Process: Cannot bind argument to parameter ‘Id’ because it is null.

After starting devilbox I get:

Get-Process -Id (Get-NetTCPConnection -LocalPort 53).OwningProcess

NPM(K) PM(M) WS(M) CPU(s) Id SI ProcessName

 31    32.62      36.82       2.58   10888   1 com.docker.backend
 21     1.49       6.83       0.14   18888   1 wslhost

Similarly before starting devilbox using powershell I get:

PS C:\Users\MarkAdmin> ping rtest.loc

Ping request could not find host rtest.loc. Please check the name and try again.

After starting devilbox powershell gives:

PS C:\Users\MarkAdmin> ping rtest.loc

Pinging rtest.loc [] with 32 bytes of data:
Reply from bytes=32 time<1ms TTL=128
Reply from bytes=32 time<1ms TTL=128
Reply from bytes=32 time=1ms TTL=128
Reply from bytes=32 time<1ms TTL=128

However, the vhost panel shows, any idea how to debug/fix

Despite these warnings the links to the vhosts do work, how is PHP doing this check, what does it mean exactly since inside the PHP container I am able to ping the vhosts e.g.

devilbox@php-7.4.12 in /shared/httpd $ ping rtest.loc
PING rtest.loc ( 56(84) bytes of data.
64 bytes from localhost ( icmp_seq=1 ttl=64 time=0.133 ms
64 bytes from localhost ( icmp_seq=2 ttl=64 time=0.048 ms
64 bytes from localhost ( icmp_seq=3 ttl=64 time=0.040 ms
64 bytes from localhost ( icmp_seq=4 ttl=64 time=0.046 ms

Are you able to reach http://rtest.loc/devilbox-api/status.json from within the PHP container?

I had somewhat of a similar problem and the way I fixed it was to update the WSL Hyper-V virtual adapter to use I would suggest that the documentation be updated to show this; currently it only shows for the main adapter, but that doesn’t work when using WSL and Docker for Windows. It probably works with Docker for Windows directly. Let me know if this works.