nameserver not being set

This forum is for discussion about general software issues.

nameserver not being set

Postby CD1 » Mon Aug 01, 2016 2:34 am

I am using arch linux arm on a Raspberry Pi for an embedded application. I have one machine which was set up around a year ago which works excellently, it does not get updated and is still on a 3.18.7 kernel. Just recently I have set up a new machine with a fresh install of arch and the latest kernel 4.4.15, this new device is not correctly setting the nameserver and cant resolve host names. The hardware for both of these machines is identical. Note this is in a commercial environment and I am behind a very restrictive proxy, however both machines are connected to the same wireless network and as far as I can see are set up the same, but something is not working on the new machine.

I have checked everything I know how to check, and cannot find anything wrong. I am hoping someone might be able to point me in the right direction for more things to test to try and narrow this problem down.

IP addresses are assigned by DHCP, on the working machine something (is it dhcpcd?) is finding the correct nameserver and entering into /etc/resolv.conf on the non working machine this is not being set and resolvconf is using the default values of 8.8.8.8 and 8.8.4.4. The google DNS will not work behind my proxy, I must use the local DNS server. If I edit /etc/resolv.conf and manually enter the local DNS and domain then it works until restart. I know I could do this and then make the file read only, but I these devices also need to work in other locations and I can't hard-code a DNS into each device.

Outputs from the working machine:
$this->bbcode_second_pass_code('', '
sudo ping 8.8.8.8 -c1
PING 8.8.8.8 (8.8.8.8) 56(84) bytes of data.
64 bytes from 8.8.8.8: icmp_seq=1 ttl=55 time=39.8 ms

--- 8.8.8.8 ping statistics ---
1 packets transmitted, 1 received, 0% packet loss, time 0ms
rtt min/avg/max/mdev = 39.891/39.891/39.891/0.000 ms

sudo ping www.google.com -c1
PING www.google.com (216.58.199.68) 56(84) bytes of data.
64 bytes from syd15s01-in-f4.1e100.net (216.58.199.68): icmp_seq=1 ttl=51 time=40.2 ms

--- www.google.com ping statistics ---
1 packets transmitted, 1 received, 0% packet loss, time 0ms
rtt min/avg/max/mdev = 40.253/40.253/40.253/0.000 ms

ifconfig wlan0
wlan0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 192.168.16.102 netmask 255.255.255.0 broadcast 192.168.16.255
inet6 fe80::211:6bff:fe58:6147 prefixlen 64 scopeid 0x20<link>
ether 00:11:6b:58:61:47 txqueuelen 1000 (Ethernet)
RX packets 86767 bytes 10246017 (9.7 MiB)
RX errors 0 dropped 179 overruns 0 frame 0
TX packets 2909 bytes 959338 (936.8 KiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0

cat /etc/resolv.conf
# Generated by resolvconf
domain xxx.co.nz
nameserver 192.168.16.6
nameserver 192.168.16.5
')

Outputs from the non working machine:
$this->bbcode_second_pass_code('', '
sudo ping 8.8.8.8 -c1
PING 8.8.8.8 (8.8.8.8) 56(84) bytes of data.
64 bytes from 8.8.8.8: icmp_seq=1 ttl=55 time=39.9 ms

--- 8.8.8.8 ping statistics ---
1 packets transmitted, 1 received, 0% packet loss, time 0ms
rtt min/avg/max/mdev = 39.975/39.975/39.975/0.000 ms

sudo ping www.google.com -c1
ping: www.google.com: Name or service not known

ifconfig wlan0
wlan0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 192.168.16.124 netmask 255.255.255.0 broadcast 192.168.16.255
inet6 fe80::211:6bff:fe58:611b prefixlen 64 scopeid 0x20<link>
ether 00:11:6b:58:61:1b txqueuelen 1000 (Ethernet)
RX packets 4563 bytes 568719 (555.3 KiB)
RX errors 0 dropped 22 overruns 0 frame 0
TX packets 554 bytes 68138 (66.5 KiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0

cat /etc/resolv.conf
# This file is managed by systemd-resolved(8). Do not edit.
#
# Third party programs must not access this file directly, but
# only through the symlink at /etc/resolv.conf. To manage
# resolv.conf(5) in a different way, replace the symlink by a
# static file or a different symlink.

nameserver 8.8.8.8
nameserver 8.8.4.4
nameserver 2001:4860:4860::8888
# Too many DNS servers configured, the following entries may be ignored.
nameserver 2001:4860:4860::8844
')
CD1
 
Posts: 15
Joined: Mon Aug 01, 2016 2:09 am

Re: nameserver not being set

Postby qinohe » Mon Aug 01, 2016 12:24 pm

Probably, systemd-resolved is in your way and sets '/etc/resolv.conf'
You can set your nameserver in '/etc/systemd/resolved.conf'
qinohe
 
Posts: 11
Joined: Thu May 15, 2014 2:14 pm

Re: nameserver not being set

Postby WarheadsSE » Mon Aug 01, 2016 1:38 pm

systemd-resolved (where the symlink of /etc/resolv.conf points to), should be using the DHCP provided nameservers.

The fact that one of the two is working tells me that it is unlikely to be systemd-resolved "getting in the way"
Core Developer
Remember: Arch Linux ARM is entirely community donation supported!
WarheadsSE
Developer
 
Posts: 6807
Joined: Mon Oct 18, 2010 2:12 pm

Re: nameserver not being set

Postby qinohe » Mon Aug 01, 2016 2:01 pm

The first machine is not managed by systemd-resolved, according to the 'cat'
qinohe
 
Posts: 11
Joined: Thu May 15, 2014 2:14 pm

Re: nameserver not being set

Postby WarheadsSE » Mon Aug 01, 2016 3:47 pm

What is being used for the DHCP? netctl? dhcpcd? systemd-networkd?
Core Developer
Remember: Arch Linux ARM is entirely community donation supported!
WarheadsSE
Developer
 
Posts: 6807
Joined: Mon Oct 18, 2010 2:12 pm

Re: nameserver not being set

Postby CD1 » Mon Aug 01, 2016 8:03 pm

$this->bbcode_second_pass_quote('', 'W')hat is being used for the DHCP? netctl? dhcpcd? systemd-networkd?


Thats probably a very good question. I believe these are all installed by default on a fresh Arch Linux Arm install? I guess part of my question is that I don't understand which package is in charge of handling the information from my DHCP server.

netctl and wifi-menu have been used to set up the wifi connection.

My netctl profile looks like this:
$this->bbcode_second_pass_code('', 'Description='Automatically generated profile by wifi-menu'
Interface=wlan0
Connection=wireless
Security=wpa
ESSID=xxxxx
IP=dhcp
Key=\"xxxx
')

/etc/dhcpcd.conf is the same on both machines and looks like this:
$this->bbcode_second_pass_code('', '
# A sample configuration for dhcpcd.
# See dhcpcd.conf(5) for details.

# Allow users of this group to interact with dhcpcd via the control socket.
#controlgroup wheel

# Inform the DHCP server of our hostname for DDNS.
hostname

# Use the hardware address of the interface for the Client ID.
#clientid
# or
# Use the same DUID + IAID as set in DHCPv6 for DHCPv4 ClientID as per RFC4361.
# Some non-RFC compliant DHCP servers do not reply with this set.
# In this case, comment out duid and enable clientid above.
duid

# Persist interface configuration when dhcpcd exits.
persistent

# Rapid commit support.
# Safe to enable by default because it requires the equivalent option set
# on the server to actually work.
option rapid_commit

# A list of options to request from the DHCP server.
option domain_name_servers, domain_name, domain_search, host_name
option classless_static_routes
# Most distributions have NTP support.
option ntp_servers
# Respect the network MTU.
# Some interface drivers reset when changing the MTU so disabled by default.
#option interface_mtu

# A ServerID is required by RFC2131.
require dhcp_server_identifier

# Generate Stable Private IPv6 Addresses instead of hardware based ones
slaac private

# A hook script is provided to lookup the hostname if not set by the DHCP
# server, but it should not be run by default.
nohook lookup-hostname
noipv4ll
')

In /etc/systemd/network there is a file 'eth0.network', however there isn't an interface named eth0 so I assume this file does nothing:
$this->bbcode_second_pass_code('', '
[Match]
Name=eth0

[Network]
DHCP=both
')
CD1
 
Posts: 15
Joined: Mon Aug 01, 2016 2:09 am

Re: nameserver not being set

Postby WarheadsSE » Tue Aug 02, 2016 2:08 am

Okay, so you're probably getting the new install using systemd-resolved by default, and the enabled systemd-networkd for eth0 is doing "the right thing" for resolved. However, since your wireless is configured via netctl/wifi-menu, that is not.

You could do one of two things:
- disable systemd-resolved usage ( rm /etc/resolv.conf; touch /etc/resolv.conf )
- or move your wifi to a mix of systemd-networkd & wpa_supplicant https://wiki.archlinux.org/index.php/WPA_supplicant#At_boot_.28systemd.29
Core Developer
Remember: Arch Linux ARM is entirely community donation supported!
WarheadsSE
Developer
 
Posts: 6807
Joined: Mon Oct 18, 2010 2:12 pm

Re: nameserver not being set

Postby CD1 » Tue Aug 02, 2016 3:12 am

OK thanks, I will have play with that and see where I get to.

As a general rule which is preferred out of netctl and wpa_supplicant?

EDIT:
I have removed netctl and installed wpa_supplicant.

Successfully configured my network following this guide here:
http://archpi.dabase.com/#wireless

And so far everything works!
CD1
 
Posts: 15
Joined: Mon Aug 01, 2016 2:09 am


Return to General

Who is online

Users browsing this forum: No registered users and 39 guests