Please provide a sample snippet to describe how to implement a DNS-Forwarder, I have found a sample for Azure File Storage but the PowerShell snippet uses CommandLet from dnsserver Module which is not available neither on WSL neither on Windows 10, it looks available only on windows server :
An easier way is to setup a small Linux VM + CoreDNS :
az vm create --name $dnsf_name \
--image UbuntuLTS \
--admin-username $dnsf_admin_username \
--resource-group $rg_name \
--vnet-name $vnet_name \
--subnet $worker_subnet_name \
--nsg $dnsf_nsg \
--size Standard_B1s \
--zone 1 \
--location $location \
--ssh-key-values ~/.ssh/$ssh_key.pub
network_interface_id=$(az vm show --name $dnsf_name -g $rg_name --query 'networkProfile.networkInterfaces[0].id' -o tsv)
echo "Bastion VM Network Interface ID :" $network_interface_id
network_interface_private_ip=$(az resource show --ids $network_interface_id \
--api-version 2019-04-01 --query 'properties.ipConfigurations[0].properties.privateIPAddress' -o tsv)
echo "Network Interface private IP :" $network_interface_private_ip
network_interface_pub_ip_id=$(az resource show --ids $network_interface_id \
--api-version 2019-04-01 --query 'properties.ipConfigurations[0].properties.publicIPAddress.id' -o tsv)
network_interface_pub_ip=$(az network public-ip show -g $rg_name --id $network_interface_pub_ip_id --query "ipAddress" -o tsv)
echo "Network Interface public IP :" $network_interface_pub_ip
Setup CoreDNS
wget https://github.com/coredns/coredns/releases/download/v1.6.9/coredns_1.6.9_linux_amd64.tgz
tar zxvf coredns_1.6.9_linux_amd64.tgz
ls -al
chmod +x coredns
./coredns -version
# /etc/coredns/Corefile
vim Corefile
.:53 {
bind 172.16.2.5 # Private IP ov the DNS server VM
forward . 168.63.129.16
log
errors
cache
}
sudo ./coredns -dns.port=53
Modify DNS on your Windows 10 client :
From CMD as admin
netsh and press Enter
netsh> prompt, type interface ip show config, then press Enter
interface ip set dns "Ethernet0" static 172.16.2.5 and press Enter. Replace Ethernet0 with the name of your connection and 172.16.2.5 with the DNS server you want to use.
Get-NetIPConfiguration
Set-DnsClientServerAddress -InterfaceIndex 8 -ServerAddresses 192.168.1.254, 172.16.2.5
Document Details
⚠ Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.
ID: 0b68f2c4-bb6c-11a2-6c61-8af4057a2438
Version Independent ID: e3498bed-1447-6841-8353-9f1b5d3dc8df
Please provide a sample snippet to describe how to implement a DNS-Forwarder, I have found a sample for Azure File Storage but the PowerShell snippet uses CommandLet from dnsserver Module which is not available neither on WSL neither on Windows 10, it looks available only on windows server :
See also https://docs.microsoft.com/en-us/azure/virtual-network/what-is-ip-address-168-63-129-16
An easier way is to setup a small Linux VM + CoreDNS :
Setup CoreDNS
Modify DNS on your Windows 10 client :
Document Details
⚠ Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.