![]() ![]() ![]() If no distributions are running, you will receive the response: "There are no running distributions." You can now restart the distribution to see your wsl.conf updates applied. You can check to see whether your Linux distribution (shell) is still running after closing it by using PowerShell with the command: wsl -list -running. You must wait ~8 seconds for the subsystem to stop before relaunching in order to give enough time for your changes to be picked up. This is not currently the case as the subsystem could still be running. You might assume that your changes to the wsl.conf file have immediately gone into effect. Ubuntu), modify the wsl.conf file, close the distribution, and then re-launch it. You must wait ~8 seconds as mentioned below in the document. Close Ubuntu and re-launch.Ĭhange will not reflect immediately. "DESKTOP-ABC222") and replace with new one (e.g. # The following lines are desirable for IPv6 capable hostsįind all occurences of hostname (e.g. To stop automatic generation of this file, add the following entry to /etc/wsl.conf:ġ27.0.1.1 DESKTOP-ABC222.localdomain DESKTOP-ABC222Ĥ4.99.0.122 You will see some entries similar to below # This file was automatically generated by WSL. Open /etc/hosts and update :~$ sudo nano /etc/hosts The hosts file contains a static map of hostnames corresponding IP address. ![]() Sudo: unable to resolve host SrcCodes: Name or service not known Otherwise, hosts file change will be overwritten during re-launch of Ubuntu and we'll get " unable to resolve host : Name or service not known" :~$ sudo apt update GenerateHosts = false will prevent WSL from automatic generation of /etc/hosts file. Hostname = SrcCodes will update the hostname in /etc/hostname. Open /etc/wsl.conf or create the same if it does not exist. Here, DESKTOP-ABC222 is hostname of Ubuntu running in my Windows 10 ( OS Build 19043.1083) WSL. Once hostname is changed, if you get " unable to resolve host : Name or service not known" then follow the step #4 for the fix. So it gets a NXDOMAIN when trying to lookup newname and this error pops out.If you are running Ubuntu on Windows WSL ( Windows Subsystem for Linux) and wondering how to change hostname permanently then follow all steps mentioned below. (My guess, based on experience, would be that when you changed the IP address and/or hostname of your current host, but you neglected to update /etc/hosts and/or didn't add a DNS entry for your new FQDN in whatever DNS server your network considers authoritative in this manner. That said, being unable to look up its own name may not be a security issue by itself, but that is a thing it should be able to do, and it would be wise to try and find out why it can't, just in case the error is masking a bigger problem. So you're very likely safe - as far as sudo is concerned, at least. Note that, like most security conscious software, sudo fails safe - if it can't look up the host, any entry that specify a host value is considered invalid. However, because that component still exists, sudo does a lookup for the current hostname to see if it may or may not match against any hypothetical entries in the sudoers file that might tell it whether or not to permit this sudo attempt. This has mostly fallen into disuse these days, but it was a way to keep the same sudoers file identical across multiple servers without having to tweak it for every single host. TL DR: Almost certainly none, but mind the qualifier.Īs man sudoers explains, there is room in a sudoers entry for a 'host' specification. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |