Hello Mohit,
Thank you for posting in Q&A forum.
Area the two Domain Controllers also DNS servers (I mean you also installed DNS role on the two servers)?
Please check the type of virtual switch of your Hyper-V.
Hyper-V has three types of virtual switches -- external, internal, and private. Create an external switch to share your computer's network with the virtual machines running on it.
This exercise walks through creating an external virtual switch. Once completed, your Hyper-V host will have a virtual switch that can connect virtual machines to the internet through your computer's network connection.
If the NIC of the hyper-V Switch is internal or private, and the domain controller (also a DNS server) built in hyper-V cannot connect to the Internet no matter how you set it.
Only the virtual switch NIC of hyper is external, and then you set up the network on the domain controller (also a DNS server) built in hyper, and this domain controller can connect to the Internet.
https://learn.microsoft.com/en-us/virtualization/hyper-v-on-windows/quick-start/connect-to-network
I hope the information above is helpful.
If you have any questions or concerns, please feel free to let us know.
Best Regards,
Daisy Zhou
============================================
If the Answer is helpful, please click "Accept Answer" and upvote it.