Get WSL2 DNS to use Hosts DNS from DHCP - wsl-2

I'm trying to use WSL2 but the DNS isn't working, nothing resolves. I've seen lots of articles about disabling resolv.conf generation and putting in a manual entry, however this won't work for me. My workplace block the port DNS uses so I can't use 1.1.1.1 etc and I can't use the corporate DNS server IP as I want a solution that will work when I go home as well.
Is there a way for WSL2 to be able to use the DNS settings provided by the Hosts DHCP lease? I've tried to change the virtual switch (WSL) in the Virtual Switch Manager to be External but it's still picking up an IP from the DHCP server.
Am I missing some Windows configuration or do I need some Linux Fu to change the config. I was trying to get Podman-Desktop running and couldn't pull any images at work which is what started this off.

Related

How to disable PfSense webConfiguration on WAN

I just installed PFSense in my network and configured the pfBlockerNG and Snort package. Its all running fine, except I have noticed by webConfiguraion GUI is accessible from the internet through my public WAN address. I have tried adding a rule to disallow anything other than LAN. I tried blocking traffic from any source to 'WAN net' on 443/80, but that didn't worked as well. Essentially, I want the GUI to be assessible within my LAN network and not from anywhere else.
What am I missing? Any help really appreciated.
PS: My firewall rules are pretty standard, default installed rules and the rules added by pfBlockerNG.
Note that once you install Pfsense it adds a "Default allow LAN" to LAN interface but there is no such rule on WAN interface.
It means you can access everything from LAN, that is, you can access WAN (and so the internet) but the access from WAN is blocked. Fortunately there is no way to access GUI from WAN by default.
This configuration is pretty the same the default config you find in a home/conventional router.
I advise you to try Pfsense for a while before installing packages.

Avahi Daemon not resolving (dot)local addresses if queried from different computer

I have two machines, one is Antergos (Arch/Linux) and the other one is Windows 10 connected to each other using LAN. The Antergos PC has a hostname of niffler and the Windows PC has a hostname of phoenix. The IP addresses to both the PCs are assigned by my router and they don't change too often. But still I want to use these PCs using their hostnames instead of their IPs. So I installed avahi and nss-mdns on niffler from the official Arch Wiki and also did everything they mentioned. To double check that I did everything correctly, I pinged niffler (ping niffler.local) using it's own terminal session and it resolved to it's correct IP. However when I use phoenix to ping to niffler, it doesn't work. When I run ping niffler.local from phoenix, it gives the error - Ping request could not find niffler.local. Please check the name and try again.

Mimic FQDN on a home machine not on a domain

I have a home PC running Windows 10, no domain controller, and therefore by default I do not have a FQDN for the machine.
I am trying to setup some server software for testing purposes, and it requires that I use a FQDN.
How can I manipulate my hosts file to mimic a FQDN?
Extra info, please let me know in comments if you need more.
There will be no other machines trying to access this other than the machine I am running the software on (my home PC)
I also think that my IP address is not static.
I believe you can just add a host entry corresponding to the IP address of your machine to all machines that need to address it using its FQDN. The hosts file can be found in System32\Drivers\etc. Just add an entry with your IP and the host to it, for example 192.168.0.1 mymachine.local.
Another option would be setting up your own DNS server which is relatively harder. The biggest problem is presented by you not having a static IP address, you should either set a static IP or configure your DHCP server to reserve an IP for you based on your adapter's MAC address.

Internet not working without preferred DNS server

My machine is connected to the office net work using wifi. My internet was working for some time without any issue. Suddenly this morning the internet stopped working although I could ping to 8.8.8.8 and other network IPs. I set the preferred DNS server and the alternate DNS server and made it work again. My question is why was it working without these settings and why did I need to enter these settings suddenly? What changes did my computer go through without me doing anything?
Had the DNS on your machine been set before? If so,minor changes to a WIFI policy would then make your machine create a second WIFI network connection. This would then make your previously set DNS no longer valid.

can't ping avahi alias from windows over LAN but can from other linux VMs

Context: i've set up a vm server for GIS testing and dokuwiki on the domain root. I'd like to serve the gis web apps on a subdomain so that dokuwiki url renaming will never conflict (and it just feels cleaner). I thought i had it solved with avahi-aliases, but then discovered...
Problem: I can't reach the subdomain from any windows pcs on the LAN. Linux VMs connect just fine. Am i trying the impossible or just doing it wrong? (i'm a DNS noob) Why would Linux find the subdomain but Windows not, even on the same LAN??
Setup:
i can't change anything on the corporate routers/servers.
VMs are on different PCs on the same corporate LAN.
VM1 (virtualbox, hosted on windows PC1): Mint 13
VM2 (virtualbox headless server, hosted on windows PC2): ubuntu server 12.04, LAMP, samba, avahi, avahi-aliases.
primary domain: vm2.local
subdomain: gis.vm2.local (configured in apache and avahi-alias)
What works:
I can reach vm2.local AND gis.vm2.local from vm1 (via ping and browser).
I can reach vm2.local from any windows pc on LAN (via ping browser).
What doesn't work: I cannot reach gis.vm2.local from any windows pcs on the LAN.
Any ideas or advice is appreciated!
Sounds like either a firewall issue or Apache/IIS (whatever is hosting your web app) isn't listening to all traffic (If you are actually sharing networks). Try a traceroute/tracert from the machines to the destination and see what paths they take. It's a little hard to troubleshoot without actually seeing how your network looks.
You can also test if your hostname resolves by trying a ping on the PC's having issues.
If it says "Ping request could not find host . Please check the name and try again" - It's a DNS issue and you can address it quickly by providing the IP of the machine with its hostname in %WINDIR%\system32\drivers\etc\hosts

Resources