If you accidentally deleted the IP and DNS settings for your Hyper-V Default switch, you can try the following steps to restore the settings:
Open the Hyper-V Manager on your Windows host computer.
Right-click on the Default switch and select "Properties."
Select the "IPv4 Address" tab and check the box for "Use the following IP address."
Enter the IP address, subnet mask, and default gateway that were previously configured for the Default switch.
Select the "DNS server" tab and check the box for "Use the following DNS server addresses."
Enter the primary and secondary DNS server addresses that were previously configured for the Default switch.
Click "OK" to save the changes.
If the above steps don't work, you can also try resetting the Default switch to its default settings:
Open the Hyper-V Manager on your Windows host computer.
Right-click on the Default switch and select "Remove."
Click "Yes" to confirm the removal of the Default switch.
Right-click on the host computer in the Hyper-V Manager and select "Virtual Switch Manager."
Click "New virtual network switch" and select "Default switch."
Click "Create virtual switch" to create a new Default switch with default settings.
Once you have created the new Default switch, you can configure the IP and DNS settings as required. Note that resetting the Default switch will remove any existing virtual machines that were connected to it, so you may need to recreate them if necessary.