Linux clients don't resolve hostname

Kernels & Hardware, configuring network, installing services

Linux clients don't resolve hostname

Postby bobbo » 2017-11-14 09:56

Hello,
in my local lan I have this setup:
A home router providing DHCP to a Debian server connected and all the other clients. I connect to it only inside my local lan, there is no outside ip involved.
Suddenly, from Linux and Android clients I cannot connect to it anymore through hostname but only through ip. From Windows client I can connect also through hostname.
I don't want to edit the host file because the server is on a laptop and i frequently change networks.

This is in my /etc/nsswitch file:
hosts: files mdns4_minimal [NOTFOUND=return] dns mdns4

This is my /etc/resolv.conf
# Generated by NetworkManager
nameserver 192.168.1.254

The address is the correct dns server of the router.

Any ideas? Thank you
bobbo
 
Posts: 3
Joined: 2017-11-14 09:53

Re: Linux clients don't resolve hostname

Postby peter_irich » 2017-11-14 18:21

Better show your /etc/network/interfaces, if you have been changed it.

Peter.
peter_irich
 
Posts: 1194
Joined: 2009-09-10 20:15
Location: Saint-Petersburg, Russian Federation

Re: Linux clients don't resolve hostname

Postby bobbo » 2017-11-14 18:46

here it is:

Code: Select all
# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).

source /etc/network/interfaces.d/*

# The loopback network interface
auto lo
iface lo inet loopback


Strangely enough I restored a previous working image of the system and it still does not work
bobbo
 
Posts: 3
Joined: 2017-11-14 09:53

Re: Linux clients don't resolve hostname

Postby peter_irich » 2017-11-14 20:11

For example, my /etc/network/interfaces. I'm is beyond the router too. enp6s0 is eth0's name.
Code: Select all
allow-hotplug enp6s0
allow-auto enp6s0
iface enp6s0 inet dhcp
network 192.168.0.0
gateway 192.168.0.1
netmask 255.255.255.0
#dns-nameserver 192.168.1.254
dns-nameserver 8.8.4.4

And resolvconf package is installed.
Enter
Code: Select all
/sbin/ifconfig

or
Code: Select all
ip link

and you will see teh network device name.

Peter.
peter_irich
 
Posts: 1194
Joined: 2009-09-10 20:15
Location: Saint-Petersburg, Russian Federation

Re: Linux clients don't resolve hostname

Postby bobbo » 2017-11-15 15:42

Using a router with openwrt solves the problem, so the problem lies in the router sent by the isp. unfortunaly doesn't have much config options. Is there something else I can do as a workaround?
bobbo
 
Posts: 3
Joined: 2017-11-14 09:53

Re: Linux clients don't resolve hostname

Postby tynman » 2017-11-15 16:21

When it was working, when you connected to your server using hostname, what process was resolving the host name?

You mention:
I don't want to edit the host file because the server is on a laptop and i frequently change networks.
2 questions:
1. Does this refer to the host file on your server or the host files on each of the client workstations?
2. What do you mean by "i frequently change networks"?

If the hostname resolution was being done using host files (which seems likely, but...) then the problem could simply be caused by a change in the IP address assigned to your server by DHCP. Whenever that occurs, you would have to update the host files on all client workstations.
tynman
 
Posts: 48
Joined: 2016-05-03 19:48
Location: British Columbia, Canada


Return to System configuration

Who is online

Users browsing this forum: No registered users and 8 guests

fashionable