Open Server Manager → Select add roles and features
Click Next untill you navigate to Server Roles → Select Remote Access → Click next and select routing → click next utill you navigate to Confirm installation selections and click Install
Server Manager → Tools → Routing and remote access → Right click DC local → Configure and enable routing and remote access → Next, select (NAT), Next → Select public interface to connect to the internet → Next → Finish
Configure DNS/DHCP (DNS is installed automatically with AD)
Confirm DNS service is running: in Server Manager → Tools → DNS → check forward lookup zones—mydomain.com should exist.
(Optional) Install DHCP role if you want the server to hand out IPs. For simplicity, you can set your client VM to static IPs or use VirtualBox NAT.
Command to verify DNS: in PowerShell: