You are not logged in.

#1 2015-12-31 01:01:41

kungfoolfighting
Member
Registered: 2014-10-22
Posts: 9

Can't resolve hostname of arch linux server on local LAN

Hello everyone,

I am at the end of my wits with this problem, as I have been trying to solve it for many many hours now.

This is the problem:
- The arch linux machine in question is my homeserver. It uses dhcpcd to get a dhcp lease from an Asus router (RT-AC56U) via a cable connection. The hostname of this server is "homeserver".
- Hostname lookup of this server from my Windows desktop had been working flawlessly until recently. This was changed after a recent arch linux update on the server.
- I have configured dhcpcd@interfacename as a service in systemd.
- I have used hostnamectl to set the hostname to "homeserver".
- The /etc/dhcpcd.conf contains the line "hostname homeserver".
- The server receives a dhcp lease with an ip.
- The /etc/hosts file contains a mapping from 127.0.0.1 and ::1 to "homeserver" even though I am assuming this is only necessary for internal hostname lookups in the server.
- The web menu of the router only lists the name that I have previously manually set for this server in the dhcp client list.
- Both "nslookup homeserver" and "ping homeserver" fail from my Windows desktop.
- Accessing the server via its IP works without a problem.
- I have done ipconfig /flushdns on the Windows desktop every time I try to do a hostname lookup.

Here is my initial dhcpcd.conf that used to work:
http://pastebin.com/kvYje8Pi
and here the one with quite a few changes, none of which make the hostname lookup work:
http://pastebin.com/hJqWiJcX

Now the strange stuff, which I don't understand at all: During all this debugging and trying around, I had set the hostname via "hostnamectl set-hostname testserver" to be "testserver". I am pretty sure that I had changed some hostname lookup related stuff in the dhcpcd.conf file. "hostnamectl" now returned "testser" as the transient hostname AND (confusingly) a nslookup from my windows desktop for "testser" actually gave me a valid dns return that gave me the correct ip, which I was able to ping.

By now I have reverted that and tried other stuff and had the same behavior appear again when setting the hostname to other stuff with certain dhcpcd.conf settings.
I have no clue how to proceed in getting this to work anymore and I would be very thankful for any help.

Thanks,
Jay

Last edited by kungfoolfighting (2015-12-31 01:02:36)

Offline

#2 2015-12-31 01:43:00

tom.ty89
Member
Registered: 2012-11-15
Posts: 897

Re: Can't resolve hostname of arch linux server on local LAN

I think you have do to think about what is/was responsible for resolving the hostname? It's won't get "discovered" automagically after you set it in /etc/hostname. In your case I suppose it's probably been done by your router. So maybe you need to figure out what does the router look at to relate the ip and the hostname.

Offline

#3 2015-12-31 01:44:01

ewaller
Administrator
From: Pasadena, CA
Registered: 2009-07-13
Posts: 20,742

Re: Can't resolve hostname of arch linux server on local LAN

Have you rebooted the router?  I used to be plagued by issues like this until I started using DD-WRT on my router.   Rebooting sometimes fixes things temporarily.


Nothing is too wonderful to be true, if it be consistent with the laws of nature -- Michael Faraday
The shortest way to ruin a country is to give power to demagogues.— Dionysius of Halicarnassus
---
How to Ask Questions the Smart Way

Offline

#4 2015-12-31 01:48:57

kungfoolfighting
Member
Registered: 2014-10-22
Posts: 9

Re: Can't resolve hostname of arch linux server on local LAN

tom.ty89 wrote:

I think you have do to think about what is/was responsible for resolving the hostname? It's won't get "discovered" automagically after you set it in /etc/hostname. In your case I suppose it's probably been done by your router. So maybe you need to figure out what does the router look at to relate the ip and the hostname.

So my thinking is that the dhcp request passes along the hostname of the dhcp client, which will then be entered in a dns table. (I read somewhere that the asuswrt router software uses dnsmasq, though I am not 100% on that.)
Any incoming dns request would then be served from the router directly if it is just a hostname and not a FQDN and if it is not just a hostname it would be passed along to my ISPs DNS server.

ewaller wrote:

Have you rebooted the router?  I used to be plagued by issues like this until I started using DD-WRT on my router.   Rebooting sometimes fixes things temporarily.

Yes, many times, sadly that has never changed anything.

Thank you guys very much for taking the time to help me.
Even just a guide on how to continue debugging would be great.

Last edited by kungfoolfighting (2015-12-31 01:49:40)

Offline

Board footer

Powered by FluxBB