Scheduled Maintenance: We are aware of an issue with Google, AOL, and Yahoo services as email providers which are blocking new registrations. We are trying to fix the issue and we have several internal and external support tickets in process to resolve the issue. Please see: viewtopic.php?t=158230

 

 

 

Linux clients don't resolve hostname

Linux Kernel, Network, and Services configuration.
Post Reply
Message
Author
bobbo
Posts: 3
Joined: 2017-11-14 09:53

Linux clients don't resolve hostname

#1 Post by bobbo »

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

peter_irich
Posts: 1403
Joined: 2009-09-10 20:15
Location: Saint-Petersburg, Russian Federation
Been thanked: 11 times

Re: Linux clients don't resolve hostname

#2 Post by peter_irich »

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

Peter.

bobbo
Posts: 3
Joined: 2017-11-14 09:53

Re: Linux clients don't resolve hostname

#3 Post by bobbo »

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

peter_irich
Posts: 1403
Joined: 2009-09-10 20:15
Location: Saint-Petersburg, Russian Federation
Been thanked: 11 times

Re: Linux clients don't resolve hostname

#4 Post by peter_irich »

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.

bobbo
Posts: 3
Joined: 2017-11-14 09:53

Re: Linux clients don't resolve hostname

#5 Post by bobbo »

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?

tynman
Posts: 131
Joined: 2016-05-03 19:48
Location: British Columbia, Canada
Been thanked: 1 time

Re: Linux clients don't resolve hostname

#6 Post by tynman »

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.

Post Reply