1

I was struggling with this for a long time. I've few devices on my network and for some reason my windows on my main pc doesnt recognize them

Console screenshot

It doesn't make much sense to me - wouldn't WSL Ubuntu derive settings from windows? I've set default dns everywhere on windows.

Settings screenshot

Do you have any idea what the problem might be?

I've also checked to make sure that network has router IP listed as DNS Settings screenshot - 2

nslookup output on windows

Default Server:  UnKnown
Address:  192.168.100.1

resolv.conf on wsl

# This file was automatically generated by WSL. To stop automatic generation of this file, add the following entry to /etc/wsl.conf:
# [network]
# generateResolvConf = false
nameserver 172.31.96.1

What's even weirder about it is the fact that nslookup resolves IP addresses correctly.

>nslookup main
Server:  UnKnown
Address:  192.168.100.1

Name: main Address: 192.168.100.89

EDIT. I've found the answer to this question in other thread: Why is 'ping' unable to resolve a name when 'nslookup' works fine? Thanks @DanielB for pointing me pointing me to the answer with nslookup command.

nxyt
  • 11

1 Answers1

0

I've found answer to this question on other thread. Thanks @DanielB for guiding me with 'nslookup' command, from that point it was easy to find related questions. Turns out that windows sometimes doesn't use dns for some reason, to force it to use it you can add '.' at the end of the name.

So: ping main doesn't work, but ping main. does. It's the same for other commands, to ssh into the device with name i used in router dns i'd have to use something like ssh username@dnsname.

If you have web services and want to access them in the browser you can do it by adding dot in the name too, for example: main.:port

nxyt
  • 11