You are not logged in.
Pages: 1
Topic closed
I would like to resolve the hostnames in my network.
I have 3 devices on Arch Linux, one uses a systemd-networkd and ethernet, another uses NetworkManager.
It has been a while that I set those up but I don't recall any problems at all with avahi.
My newest device uses netctl profile for a static IP, and it works except for the local hostname resolution.
I followed the wiki page on avahi, but to no avail. I cannot resolve the other machines' names and they cannot resolve this one.
https://wiki.archlinux.org/index.php/Av … resolution
I assume it has something to do with the DNS entry in my netctl profile. However I could not find the necessary information in the wiki or the web.
Any help is appreciated.
My netctl profile. I tried some thisg for the DNS but not successfully.
Description='A simple WPA encrypted wireless connection using a static IP'
Interface=wlp0s20u2
Connection=wireless
Security=wpa
ESSID='xxx'
Key='yyy'
IP=static
Address='192.168.0.98/24'
Gateway='192.168.0.1'
DNS='192.168.0.1'
#DNS=('8.8.8.8' '8.8.4.4')
#DNSDOMAIN=('192.168.0.*')
#DNSSEARCH=('localhost')My /etc/nsswitch.conf:
# Begin /etc/nsswitch.conf
passwd: compat mymachines systemd
group: compat mymachines systemd
shadow: compat
publickey: files
hosts: files mymachines mdns_minimal [NOTFOUND=return] resolve [!UNAVAIL=return] dns myhostname
#hosts: files mdns [NOTFOUND=return] dns myhostname
networks: files
protocols: files
services: files
ethers: files
rpc: files
netgroup: files
# End /etc/nsswitch.confMy /etc/resolv.conf:
nameserver 192.168.0.1I assume something is missing here since there are additional cryptic lines on my other two machines.
My /etc/hostname:
pddesktopMy /etc/hosts:
#
# /etc/hosts: static lookup table for host names
#
#<ip-address> <hostname.domain.org> <hostname>
127.0.0.1 localhost.localdomain localhost
::1 localhost.localdomain localhost
127.0.1.1 pddesktop.localdomain pddesktop
# End of fileoutput from systemctl status avahi-daemon.service -n 50:
Nov 11 17:49:53 pddesktop systemd[1]: Starting Avahi mDNS/DNS-SD Stack...
Nov 11 17:49:53 pddesktop avahi-daemon[321]: Found user 'avahi' (UID 84) and group 'avahi' (GID 84).
Nov 11 17:49:53 pddesktop avahi-daemon[321]: Successfully dropped root privileges.
Nov 11 17:49:53 pddesktop avahi-daemon[321]: avahi-daemon 0.7 starting up.
Nov 11 17:49:53 pddesktop avahi-daemon[321]: Successfully called chroot().
Nov 11 17:49:53 pddesktop avahi-daemon[321]: Successfully dropped remaining capabilities.
Nov 11 17:49:53 pddesktop avahi-daemon[321]: No service file found in /etc/avahi/services.
Nov 11 17:49:53 pddesktop systemd[1]: Started Avahi mDNS/DNS-SD Stack.
Nov 11 17:49:53 pddesktop avahi-daemon[321]: Network interface enumeration completed.
Nov 11 17:49:53 pddesktop avahi-daemon[321]: Server startup complete. Host name is pddesktop.local. Local service cookie is 3643817906.
Nov 11 17:50:00 pddesktop avahi-daemon[321]: Joining mDNS multicast group on interface wlp0s20u2.IPv4 with address 192.168.0.98.
Nov 11 17:50:00 pddesktop avahi-daemon[321]: New relevant interface wlp0s20u2.IPv4 for mDNS.
Nov 11 17:50:00 pddesktop avahi-daemon[321]: Registering new address record for 192.168.0.98 on wlp0s20u2.IPv4.
Nov 11 17:50:00 pddesktop avahi-daemon[321]: Joining mDNS multicast group on interface wlp0s20u2.IPv6 with address fe80::1ad6:c7ff:fe11:bba7.
Nov 11 17:50:00 pddesktop avahi-daemon[321]: New relevant interface wlp0s20u2.IPv6 for mDNS.
Nov 11 17:50:00 pddesktop avahi-daemon[321]: Registering new address record for fe80::1ad6:c7ff:fe11:bba7 on wlp0s20u2.*.
Nov 11 17:50:02 pddesktop avahi-daemon[321]: Leaving mDNS multicast group on interface wlp0s20u2.IPv6 with address fe80::1ad6:c7ff:fe11:bba7.
Nov 11 17:50:02 pddesktop avahi-daemon[321]: Joining mDNS multicast group on interface wlp0s20u2.IPv6 with address 2a02:aa13:247f:d300:1ad6:c7ff:fe11:bba7.
Nov 11 17:50:02 pddesktop avahi-daemon[321]: Registering new address record for 2a02:aa13:247f:d300:1ad6:c7ff:fe11:bba7 on wlp0s20u2.*.
Nov 11 17:50:02 pddesktop avahi-daemon[321]: Withdrawing address record for fe80::1ad6:c7ff:fe11:bba7 on wlp0s20u2.Last edited by PhilippD (2017-11-12 12:09:51)
Offline
From your /etc/hosts:
127.0.0.1 localhost.localdomain localhost
127.0.1.1 pddesktop.localdomain pddesktopis it normal to have two different loopback addresses in your case?
Offline
From the Arch Wiki Installation guide:
/etc/hosts
127.0.0.1 localhost.localdomain localhost
::1 localhost.localdomain localhost
127.0.1.1 myhostname.localdomain myhostnameSo I believe this is correct.
Offline
Ok, that was trivial of me.
Assuming this
Nov 11 17:49:53 pddesktop avahi-daemon[321]: No service file found in /etc/avahi/services. is out of your free will,
I'm not seeing any ULA ipv6 address. I know, I'm circling around the problem but these are the only thing i can assume according to what you posted (and i don't know what else output may be relevant anyway). What you configured seems legit so far.
Last edited by lo1 (2017-11-11 18:12:50)
Offline
Is 192.168.0.1 (your router I am assuming) your DNS for the LAN? Are you using pi-hole on your LAN? Post the output of:
# nmap -sn 192.168.0.0/24 -oG -Offline
I don't use avahi here, but did you try to resolve with avahi-resolve? That should cut out a lot of the stack and make troubleshooting easier.
Edit: Did you set up iptables / a firewall? Then there may be ports you have to open for avahi.
Last edited by progandy (2017-11-11 18:23:34)
| alias CUTF='LANG=en_XX.UTF-8@POSIX ' | alias ENGLISH='LANG=C.UTF-8 ' |
Offline
Thanks for your replies.
Is 192.168.0.1 (your router I am assuming) your DNS for the LAN? Are you using pi-hole on your LAN? Post the output of:
# nmap -sn 192.168.0.0/24 -oG -
Yes 192.168.0.1 is my router, but I am not sure if it is the DNS. I didn't configure the router aside from the name and password of the wifi. It has not been necessary for the other devices, either, and I have used those in another network before and they resolved each others host names.
I'm not using pi-hole.
[root@pddesktop philipp]# nmap -sn 192.168.0.0/24 -oG -
# Nmap 7.60 scan initiated Sat Nov 11 20:28:40 2017 as: nmap -sn -oG - 192.168.0.0/24
Host: 192.168.0.1 (compalhub.home) Status: Up
Host: 192.168.0.99 () Status: Up
Host: 192.168.0.98 () Status: Up
# Nmap done at Sat Nov 11 20:28:42 2017 -- 256 IP addresses (3 hosts up) scanned in 1.94 seconds192.168.0.99 is the static ip of my Raspberry Pi.
I don't use avahi here, but did you try to resolve with avahi-resolve? That should cut out a lot of the stack and make troubleshooting easier.
Edit: Did you set up iptables / a firewall? Then there may be ports you have to open for avahi.
avahi-resolve works as expected for my two other devices, but not for this one.
In the meantime I found this in the wiki:
https://wiki.archlinux.org/index.php/Resolv.conf
If you are using netctl and static IP address assignment, do not use the DNS* options in your profile, otherwise resolvconf is called and /etc/resolv.conf overwritten.
So I removed the DNS line in my netctl profile and restarted it, but it didn't help. My resolv.conf still has this one line only.
Now I am pretty sure that this file is not correct, it should have more entries.
For the reference, on my Raspberry pi it looks like this:
# This file is managed by man:systemd-resolved(8). Do not edit.
#
# This is a dynamic resolv.conf file for connecting local clients directly to
# all known DNS servers.
#
# Third party programs must not access this file directly, but only through the
# symlink at /etc/resolv.conf. To manage man:resolv.conf(5) in a different way,
# replace this symlink by a static file or a different symlink.
#
# See man:systemd-resolved.service(8) for details about the supported modes of
# operation for /etc/resolv.conf.
nameserver 2001:730:3e82::10
nameserver 2001:730:3e82::11Starting the systemd-resolved service did not help.
Offline
That's it: you need to get your dns server ipv6 address and add it to your resolvconf, it seems ula is not necessary.
Edit: perhaps to your netctl profile, not the resolvconf...
Last edited by lo1 (2017-11-11 19:53:39)
Offline
Well I don't have a dedicated DNS server. If you mean the router, it was originally part of my netctl file (192.168.0.1). Are you sure the IPv6 address is important and IPv4 is not enough?
Offline
If you're not using IPv6, I recommend disabling it.
Offline
If you're not using IPv6, I recommend disabling it.
His gateway provided a unicast global address (2a02:...) and the interface is using a link local ipv6 (fe80::...) so the gateway is working on both ipv6 and ipv4. The raspberry itself has a DNS server (its gateway unless we're talking badass network) known for his ipv6 address, so this seems relevant to me.
@PhilippD, I'm talking out of basic knowledge, so you'll need to try a little bit since I never used avahi myself.
Take a look at the others nodes in your network, if they point to a DNS server (which is your gateway) which has an ipv6 address, then most likely you'll need to do as I suggested above.
Offline
Thanks for your help.
I stopped using netctl and use NetworkManager and dhcpcd now.
My resolve.conf now looks better, and at least my other machines can resolve my new machine now, but not vice-versa
.
But it is fine for me now. In the meantime I found out that I can assign static IPs through my router, which means I don't really need hostname resolution as long as I am able to remember the 3 ip addresses.
I will mark this topic as solved.
Offline
Sorry for bumping up this post, but I faced the same problem and easily solved it though installing
ifplugd
Offline
Sorry for bumping up this post, but I faced the same problem and easily solved it though installing
ifplugd
Please do not necrobump.
Closing.
Offline
Pages: 1
Topic closed