Unable to resolve Windows LAN hostnames Topic is solved

Having issues with your DietPi installation, or, found a bug? Post it here.
Mattie

Unable to resolve Windows LAN hostnames

Post by Mattie »

After doing a fresh DietPi v102 install, I'm unable to resolve other machines hostnames.
Raspberry Pi 2
Connected through lan
DHCP (static ip given by router)
Other machines are windows machines.
Ping from windows machine to rp hostname works, ping from rp to hostname of windows machine does not.
Ping from rp to LAN ip works, ping from rp to external domain works.

In the past I've been using an older version of DietPi and never had any issues with this.

Any help is appriciated
User avatar
Fourdee
Site Admin
Posts: 2788
Joined: Tue Feb 06, 2007 1:36 pm

Re: Unable to resolve LAN hostnames

Post by Fourdee »

Mattie wrote:After doing a fresh DietPi v102 install, I'm unable to resolve other machines hostnames.
Raspberry Pi 2
Connected through lan
DHCP (static ip given by router)
Other machines are windows machines.
Ping from windows machine to rp hostname works, ping from rp to hostname of windows machine does not.
Ping from rp to LAN ip works, ping from rp to external domain works.

In the past I've been using an older version of DietPi and never had any issues with this.

Any help is appriciated
Hi Mattie,

This may be linked to:https://github.com/Fourdee/DietPi/issues/135 which has been resolved for v103.

For now, can you please try the following:

Code: Select all

apt-get install resolvconf -y
reboot
Let me know if you are still unable to ping your Windows systems.
If you find our project or support useful, then we’d really appreciate it if you’d consider contributing to the project however you can.
Donating is the easiest – you can use PayPal or become a DietPi patron.
Mattie

Re: Unable to resolve LAN hostnames

Post by Mattie »

I did that, but it stated it was only for static config.

I posted my question after a lot of googling, but appearantly not enough...
I solved it by installing winbinds and adding wins to the hosts entry of /etc/nsswitch.conf
User avatar
Fourdee
Site Admin
Posts: 2788
Joined: Tue Feb 06, 2007 1:36 pm

Re: Unable to resolve LAN hostnames

Post by Fourdee »

Mattie wrote:I did that, but it stated it was only for static config.
Resolvconf will update your DNS records when using DHCP.
I posted my question after a lot of googling, but appearantly not enough...
I solved it by installing winbinds and adding wins to the hosts entry of /etc/nsswitch.conf
Intresting. Thanks for sharing.
I was thinking about adding this as default to DietPi systems, but winbinds is a big installation 49mb~ with lots of dependencies.
If you find our project or support useful, then we’d really appreciate it if you’d consider contributing to the project however you can.
Donating is the easiest – you can use PayPal or become a DietPi patron.
Mattie

Re: Unable to resolve Windows LAN hostnames

Post by Mattie »

Did previous installations have winbinds included? I can't remember adding it myself last time i set up this server (more than 6 months ago)
User avatar
Fourdee
Site Admin
Posts: 2788
Joined: Tue Feb 06, 2007 1:36 pm

Re: Unable to resolve Windows LAN hostnames

Post by Fourdee »

Mattie wrote:Did previous installations have winbinds included? I can't remember adding it myself last time i set up this server (more than 6 months ago)
HI Mattie,

winbinds has never been installed on any DietPi systems/images. It may be pulled in with another package, samba fileserver/client?
If you find our project or support useful, then we’d really appreciate it if you’d consider contributing to the project however you can.
Donating is the easiest – you can use PayPal or become a DietPi patron.
Mattie

Re: Unable to resolve Windows LAN hostnames

Post by Mattie »

Ok, i just did a test to see if the bugfix for 103 solved it.
I rewrote 102 wheezy, it auto updates to 103. After that windows hostnames are still not found, so i assume installing winbounds is the only way.
HOWEVER, on 103 it doesnt resolve any hostnames anymore, so apt-get update failes (and so does the internet test in dietpi-software).
This was never the case in v102. It looks like with DHCP it doesnt use the gateway as dns.

Is there any way to install 102 and not let it auto update to 103? When i had 102 set up and manually added the resolveconf package i had no issues.
User avatar
Fourdee
Site Admin
Posts: 2788
Joined: Tue Feb 06, 2007 1:36 pm

Re: Unable to resolve Windows LAN hostnames

Post by Fourdee »

Mattie wrote:Ok, i just did a test to see if the bugfix for 103 solved it.
I rewrote 102 wheezy, it auto updates to 103. After that windows hostnames are still not found, so i assume installing winbounds is the only way.
HOWEVER, on 103 it doesnt resolve any hostnames anymore, so apt-get update failes (and so does the internet test in dietpi-software).
This was never the case in v102. It looks like with DHCP it doesnt use the gateway as dns.

Is there any way to install 102 and not let it auto update to 103? When i had 102 set up and manually added the resolveconf package i had no issues.
Hi Mattie,

The update is automatic. It can be prevented (a cheeky hack) but will require you to change the following file after writing the image:

Code: Select all

#Change to file contents below from 102 to 1000
/boot/dietpi/.version
Ideally, I'd like to see the contents of your resolv.conf and network config so we can find the cause. Please paste the following results:

Code: Select all

cat /etc/resolv.conf
cat /etc/network/interfaces
If you find our project or support useful, then we’d really appreciate it if you’d consider contributing to the project however you can.
Donating is the easiest – you can use PayPal or become a DietPi patron.
Mattie

Re: Unable to resolve Windows LAN hostnames

Post by Mattie »

Well i tried to check the resolv.conf as well and it didnt exist. When i manually added resolvconf package to 102 it did:

Code: Select all

root@rp-server:~# cat /etc/resolv.conf
cat: /etc/resolv.conf: Not a directory

root@rp-server:~# cat /etc/network/interfaces
#/etc/network/interfaces

# Local
auto lo
iface lo inet loopback

# Ethernet
auto eth0
iface eth0 inet dhcp
address 192.168.1.101
netmask 255.255.255.0
gateway 192.168.1.202
dns-nameservers

# Wifi
#auto wlan0
iface wlan0 inet static
address 192.168.1.101
netmask 255.255.255.0
gateway 192.168.1.202
wireless-essid FuzonWifi
wireless-key abcde12345
wireless-mode Managed
wireless-power off
wpa-ssid FuzonWifi
wpa-psk abcde12345
dns-nameservers
User avatar
Fourdee
Site Admin
Posts: 2788
Joined: Tue Feb 06, 2007 1:36 pm

Re: Unable to resolve Windows LAN hostnames

Post by Fourdee »

Mattie wrote:Well i tried to check the resolv.conf as well and it didnt exist. When i manually added resolvconf package to 102 it did:
Thanks Mattie,

resolvconf is installed and configured with the v103 update, at least, it should be :) I'am eager to find out why your system has issues with v103.

Is there any chance you could test a fresh install of DietPi, let it update to v103, go through the install process. Once the system is installed, rebooted and ready, run these commands again:

Code: Select all

cat /etc/resolv.conf
cat /etc/network/interfaces
If you find our project or support useful, then we’d really appreciate it if you’d consider contributing to the project however you can.
Donating is the easiest – you can use PayPal or become a DietPi patron.
Post Reply