TransWikia.com

How do I resolve DNS addresses with Automotive Grade Linux (Halibut 8.0.0)?

Unix & Linux Asked on February 10, 2021

I have Automotive Grade Linux (Halibut 8.0.0) installed on a Qualcomm board.
I can bring up ethernet okay.

sa8155:~# ifconfig eth0 up
sa8155:~# udhcpc
udhcpc: started, v1.29.3
udhcpc: sending discover
udhcpc: sending select for 10.0.0.112
udhcpc: lease of 10.0.0.112 obtained, lease time 604800
/etc/udhcpc.d/50default: Adding DNS 75.75.75.75
/etc/udhcpc.d/50default: Adding DNS 75.75.76.76

Notice that DHCP reports that the name servers are being retrieved correctly.

And I can ping the name servers:

sa8155:~# ping 75.75.75.75
PING 75.75.75.75 (75.75.75.75): 56 data bytes
64 bytes from 75.75.75.75: seq=0 ttl=58 time=8.973 ms
64 bytes from 75.75.75.75: seq=1 ttl=58 time=19.634 ms
64 bytes from 75.75.75.75: seq=2 ttl=58 time=11.391 ms

However, I cannot use DNS to resolve any names.

sa8155:~# nslookup debian.org
nslookup: write to '127.0.0.1': Connection refused
;; connection timed out; no servers could be reached

I noticed that /etc/resolv.conf is empty
other than this comment:

sa8155:~# cat /etc/resolv.conf 
# Generated by Connection Manager

I tried manually editing /etc/resolv.conf like so:

sa8155:~# cat /etc/resolv.conf 
# Generated by Connection Manager
search example.com local.test
nameserver 75.75.75.75
nameserver 75.75.76.76

But that seems to disable the ethernet interface altogether.

sa8155:~# nslookup www.google.com
nslookup: write to '127.0.0.1': Connection refused
;; connection timed out; no servers could be reached

I tried manually adding a single host and ip address pair to /etc/hosts,
but I could not edit that file even though I am root.

sa8155:~# ls -alF /etc/ | grep host
-rw-r--r--  1 root     root         26 Nov 13  2019 host.conf
-rw-r--r--  1 root     root     111912 Nov 13  2019 hostapd.conf
-rw-r--r--  1 root     root          7 Nov 13  2019 hostname
-rw-r--r--  1 root     root        237 Nov 13  2019 hosts
-rw-r--r--  1 root     root          0 Nov 13  2019 hosts.allow
-rw-r--r--  1 root     root          0 Nov 13  2019 hosts.deny
sa8155:~# chmod 766 /etc/hosts
chmod: changing permissions of `/etc/hosts': Read-only file system

So I tried using ConnMan to add the DNS entries.

Here is the procedure

However, connmanctl services does not return the expected list.

sa8155:~# connmanctl services
Error: The name net.connman was not provided by any .service files
sa8155:~# 

UPDATE: cat /etc/nsswitch.conf

sa8155:/etc/systemd/network# cat /etc/nsswitch.conf 
# /etc/nsswitch.conf
#
# Example configuration of GNU Name Service Switch functionality.
# If you have the `glibc-doc' and `info' packages installed, try:
# `info libc "Name Service Switch"' for information about this file.

passwd:         compat
group:          compat
shadow:         compat

hosts:          localuser files myhostname  mdns4_minimal [NOTFOUND=return] dns
networks:       files

protocols:      db files
services:       db files
ethers:         db files
rpc:            db files

netgroup:       nis
sa8155:/etc/systemd/network# 

One Answer

I had some similar issue with a Yocto distribution on Tegra. My problem was that both connman and systemd-networkd were configured and fighting to get the resource.

In case you use systemd, make sure no network configuration matches the interfaces you want to use with connman.

networkd .network file are in /etc/systemd/network. That folder is now empty since I want connman to manage all my interfaces.

Answered by Damien LEFEVRE on February 10, 2021

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP