DNS defaults to 127.0.0.1

February 23rd, 2012 Leave a comment Go to comments

Home › Forums › GeeXboX for PC › DNS defaults to 127.0.0.1

This topic has 2 voices, contains 11 replies, and was last updated by  tomlohave 10 hours ago.

Viewing 12 posts - 1 through 12 (of 12 total)
Author Posts
Author Posts
February 23, 2012 at 15:30 #3108

tadhgocuilleain

I used geexbox-devel-20120221-r13974-i386.iso to install to HDD as described here: http://www.geexbox.org/forum/topic/trying-to-install-geexbox-to-hdd/

It installed okay, but I’m using static IPs instead of DHCP. I have set my network settings including DNS server in /etc/network, but on the “System Info” screen DNS server is shown as 127.0.0.1, although I have the following in /etc/network:

# List of DNS servers (e.g. “192.168.1.253;192.168.1.254″)
DNS_SERVER=”10.10.10.1″

If I manually change /etc/resolv.conf to:
nameserver 10.10.10.1

DNS lookups work fine until reboot.

Have I missed something? Is there a reason why the DNS server set in /etc/network is being ignored?

Thanks in advance.

February 23, 2012 at 16:17 #3110

tomlohave

hi,

can you post the content of /var/lib/connman/default.profile ?
thanks

February 23, 2012 at 16:22 #3111

tadhgocuilleain

[ethernet_00016c31338f_cable]
IPv4.method=manual
IPv4.local_address=10.10.10.2
IPv4.netmask_prefixlen=24
IPv4.gateway=10.10.10.1
Nameservers=10.10.10.1;
Name=Wired
Modified=2012-02-23T19:42:10.640391Z
IPv6.method=off
IPv6.privacy=disabled

February 23, 2012 at 16:56 #3117

tomlohave

even without adding my nameserver to /etc/resolv.conf, no problem for internet access, in systemd log, connman says it add my maneserver. Do you have a problem with internet access ?

February 23, 2012 at 17:18 #3120

tadhgocuilleain

Weather and scrapers don’t work unless I manually add the nameserver to resolv.conf

February 24, 2012 at 00:15 #3122

tomlohave

ok we’ll reproduce this. i’ve arleady an idea how to fix this.

February 25, 2012 at 05:18 #3140

tomlohave

in /usr/lib/connman, can you edit the file connman-parse-configuration and apply this change :
-[ -n "$DNS_SERVER" ] && echo “Nameservers=$DNS_SERVER;” >> $profile
-
+if [ -n "$DNS_SERVER" ] ; then
+ echo “Nameservers=$DNS_SERVER;” >> $profile
+ OLDIFS=$IFS
+ IFS=”;”
+ for i in $DNS_SERVER ; do
+ echo “nameserver $i” >> /etc/resolv.conf
+ done
+ IFS=$OLDIFS
+fi
+

February 25, 2012 at 05:19 #3141

tomlohave

then do systemctl restart connman.service

February 25, 2012 at 06:44 #3142

tadhgocuilleain

Strangely, I noticed that before making the change, DNS lookups were working (weather data was displayed), and I can ping google, but the contents of resolv.conf is still 127.0.0.1.

I made the change above, but nothing has changed. System Info and resolv.conf still show DNS server as 127.0.0.1, but for some reason look ups have started working.

February 25, 2012 at 12:21 #3144

tomlohave

that’s because first nameserver is 127.0.0.1 ?
look in /etc/resolv.conf

February 25, 2012 at 12:36 #3145

tadhgocuilleain

contents of /etc/resolv.conf:

# Generated by Connection Manager
nameserver 127.0.0.1

February 25, 2012 at 13:46 #3146

tomlohave

arf, connman rewrite /etc/resolv.conf, why it doesn’t write the good dn server is a mistery ….

can you create a file in /bin called gen-resolv (chmod +x) that contains :

#!/bin/sh
. /etc/funcs
wait_for_network
sleep 5
. /etc/network
if [ -n "$DNS_SERVER" ] ; then
echo “” > /etc/resolv.conf
OLDIFS=$IFS
IFS=”;”
for i in $DNS_SERVER ; do
echo “nameserver $i” >> /etc/resolv.conf
done
IFS=$OLDIFS
fi

in file /lib/systemd/system/connman.service

add in section [Service]

ExecStartPost=/bin/gen-resolv

(not tested, i’m not at home …)

Viewing 12 posts - 1 through 12 (of 12 total)

You must be logged in to reply to this topic.