Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
NetworkManager doesn't do DNS resolving [solved]
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Networking & Security
View previous topic :: View next topic  
Author Message
cyberpatrol
Apprentice
Apprentice


Joined: 18 Sep 2003
Posts: 161
Location: Germany

PostPosted: Mon Aug 12, 2013 11:02 pm    Post subject: NetworkManager doesn't do DNS resolving [solved] Reply with quote

I'm trying to use NetworkManager. It finds my ethernet card (eth0) and seems to establish a wired connection. It also overwrites /etc/resolv.conf correctly. But domain names aren't resolved.

When NetworkManager is started at boot time I get this message:
Code:
* Starting NetworkManager ...                                                                                                                        [ ok ]
Gets connected...............    1s
 * Marking NetworkManager as inactive. It will automatically be marked
 * as started after a network connection has been established.
 * WARNING: NetworkManager has started, but is inactive


When I then run ping I get this error message:
Code:
$ ping -c 3 www.gentoo.org
ping: unknown host www.gentoo.org


Those are my init scripts:
Code:
# rc-update show
       NetworkManager |      default                 
                acpid | boot                         
            alsasound | boot                         
             bootmisc | boot                         
          consolefont | boot                         
           consolekit |      default                 
                cupsd |      default                 
                 dbus |      default                 
                devfs |                       sysinit
              dmcrypt | boot                         
                dmesg |                       sysinit
           fbcondecor | boot                         
                fcron |      default                 
                 fsck | boot                         
                  gpm |      default                 
              hddtemp |      default                 
             hostname | boot                         
              hwclock | boot                         
              keymaps | boot                         
            killprocs |              shutdown       
           lm_sensors |      default                 
                local |      default                 
           localmount | boot                         
                  lvm | boot                         
              modules | boot                         
             mount-ro |              shutdown       
                 mtab | boot                         
               net.lo | boot                         
             netmount |      default                 
              numlock |      default                 
              privoxy |      default                 
               procfs | boot                         
                 root | boot                         
            savecache |              shutdown       
                 swap | boot                         
            swapfiles | boot                         
               sysctl | boot                         
                sysfs |                       sysinit
            syslog-ng |      default                 
         termencoding | boot                         
       tmpfiles.setup | boot                         
                 udev |                       sysinit
           udev-mount |                       sysinit
              urandom | boot                         
                  xdm |      default


NetworkManager and nm-applet are installed with those USE flags:
Code:
net-misc/networkmanager-0.9.8.2-r3  USE="consolekit dhcpcd introspection modemmanager nss ppp -avahi -bluetooth -connection-sharing -dhclient -gnutls -resolvconf -systemd {-test} -vala -wext"
gnome-extra/nm-applet-0.9.8.2  USE="introspection modemmanager -bluetooth -gconf"


Does anyone have an idea how this can be fixed?


Last edited by cyberpatrol on Tue Aug 13, 2013 4:32 am; edited 1 time in total
Back to top
View user's profile Send private message
666threesixes666
Veteran
Veteran


Joined: 31 May 2011
Posts: 1248
Location: 42.68n 85.41w

PostPosted: Mon Aug 12, 2013 11:19 pm    Post subject: Reply with quote

my system shows

mkultra@mksrv [ ~ ]$ cat /etc/resolv.conf
nameserver 8.8.4.4

can you ping 8.8.8.8?? i set static ip and static dns on my setup....
Back to top
View user's profile Send private message
cyberpatrol
Apprentice
Apprentice


Joined: 18 Sep 2003
Posts: 161
Location: Germany

PostPosted: Mon Aug 12, 2013 11:40 pm    Post subject: Reply with quote

I haven't tried it, yet, but I doubt that I want to tell Google every website I visit.

My ISP's own DNS server is working correctly since I don't have a problem with DNS resolving when using /etc/init.d/net.eth0 to establish a network connection. And NetworkManager writes the same DNS IPs into /etc/resolv.conf as /etc/init.d/net.eth0 does, just with a different comment.
Back to top
View user's profile Send private message
666threesixes666
Veteran
Veteran


Joined: 31 May 2011
Posts: 1248
Location: 42.68n 85.41w

PostPosted: Tue Aug 13, 2013 12:04 am    Post subject: Reply with quote

comment the report of cat /etc/resolv.conf with x.x.x.x or 8.8.8.8 instead of your real dns. don't worry ill spam their data hoard with 90,000 brazzers and gentoo hits for you. maybe set 8.8.8.8 for testing & reporting only....
Back to top
View user's profile Send private message
Jaglover
Watchman
Watchman


Joined: 29 May 2005
Posts: 8291
Location: Saint Amant, Acadiana

PostPosted: Tue Aug 13, 2013 12:08 am    Post subject: Reply with quote

I'd say look at ifconfig -a output. Is your eth0 getting an IP address?
_________________
My Gentoo installation notes.
Please learn how to denote units correctly!
Back to top
View user's profile Send private message
cyberpatrol
Apprentice
Apprentice


Joined: 18 Sep 2003
Posts: 161
Location: Germany

PostPosted: Tue Aug 13, 2013 12:19 am    Post subject: Reply with quote

Adding 8.8.8.8 to resolv.conf doesn't help as expected.
ifconfig -a as well as nm-applet show an IP address given by my ISP. So the internet connection is established, just no DNS resolving.

Btw., I found out that `host <IP address>` doesn't work either with NetworkManager.
Back to top
View user's profile Send private message
Jaglover
Watchman
Watchman


Joined: 29 May 2005
Posts: 8291
Location: Saint Amant, Acadiana

PostPosted: Tue Aug 13, 2013 12:29 am    Post subject: Reply with quote

Try dig @<yourdnsyouaretesting> <somedomain>, will it resolve or give you an error? For instance, dig @8.8.8.8 www.google.gom
_________________
My Gentoo installation notes.
Please learn how to denote units correctly!
Back to top
View user's profile Send private message
cyberpatrol
Apprentice
Apprentice


Joined: 18 Sep 2003
Posts: 161
Location: Germany

PostPosted: Tue Aug 13, 2013 12:45 am    Post subject: Reply with quote

dig gives me that output:
Code:
# dig @8.8.8.8 www.google.com

; <<>> DiG 9.9.3-P2 <<>> @8.8.8.8 www.google.com
; (1 server found)
;; global options: +cmd
;; connection timed out; no servers could be reached
# dig @8.8.8.8 www.gentoo.org

; <<>> DiG 9.9.3-P2 <<>> @8.8.8.8 www.gentoo.org
; (1 server found)
;; global options: +cmd
;; connection timed out; no servers could be reached

The same with the DNS server of my ISP's instead of 8.8.8.8.
Back to top
View user's profile Send private message
Jaglover
Watchman
Watchman


Joined: 29 May 2005
Posts: 8291
Location: Saint Amant, Acadiana

PostPosted: Tue Aug 13, 2013 12:53 am    Post subject: Reply with quote

Do you have any firewall in action blocking port 53?
_________________
My Gentoo installation notes.
Please learn how to denote units correctly!
Back to top
View user's profile Send private message
cyberpatrol
Apprentice
Apprentice


Joined: 18 Sep 2003
Posts: 161
Location: Germany

PostPosted: Tue Aug 13, 2013 1:22 am    Post subject: Reply with quote

Port 53 is open for UDP and blocked for TCP. If it was blocked, DNS resolving wouldn't work with net.eth0 either.
Back to top
View user's profile Send private message
666threesixes666
Veteran
Veteran


Joined: 31 May 2011
Posts: 1248
Location: 42.68n 85.41w

PostPosted: Tue Aug 13, 2013 1:25 am    Post subject: Reply with quote

"don't have a problem with DNS resolving when using /etc/init.d/net.eth0" is what confuses me with the dig results....
Back to top
View user's profile Send private message
cyberpatrol
Apprentice
Apprentice


Joined: 18 Sep 2003
Posts: 161
Location: Germany

PostPosted: Tue Aug 13, 2013 1:46 am    Post subject: Reply with quote

Btw., this is the dig output with net.eth0:

Code:
# dig @8.8.8.8 www.google.com

; <<>> DiG 9.9.3-P2 <<>> @8.8.8.8 www.google.com
; (1 server found)
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 38096
;; flags: qr rd ra; QUERY: 1, ANSWER: 16, AUTHORITY: 0, ADDITIONAL: 1

;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 512
;; QUESTION SECTION:
;www.google.com.         IN   A

;; ANSWER SECTION:
www.google.com.      300   IN   A   64.15.112.109
www.google.com.      300   IN   A   64.15.112.88
www.google.com.      300   IN   A   64.15.112.98
www.google.com.      300   IN   A   64.15.112.103
www.google.com.      300   IN   A   64.15.112.108
www.google.com.      300   IN   A   64.15.112.118
www.google.com.      300   IN   A   64.15.112.99
www.google.com.      300   IN   A   64.15.112.104
www.google.com.      300   IN   A   64.15.112.84
www.google.com.      300   IN   A   64.15.112.113
www.google.com.      300   IN   A   64.15.112.119
www.google.com.      300   IN   A   64.15.112.94
www.google.com.      300   IN   A   64.15.112.89
www.google.com.      300   IN   A   64.15.112.123
www.google.com.      300   IN   A   64.15.112.114
www.google.com.      300   IN   A   64.15.112.93

;; Query time: 23 msec
;; SERVER: 8.8.8.8#53(8.8.8.8)
;; WHEN: Di Aug 13 03:40:46 CEST 2013
;; MSG SIZE  rcvd: 299

# dig @8.8.8.8 www.gentoo.org

; <<>> DiG 9.9.3-P2 <<>> @8.8.8.8 www.gentoo.org
; (1 server found)
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 52060
;; flags: qr rd ra ad; QUERY: 1, ANSWER: 2, AUTHORITY: 0, ADDITIONAL: 1

;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 512
;; QUESTION SECTION:
;www.gentoo.org.         IN   A

;; ANSWER SECTION:
www.gentoo.org.      1493   IN   CNAME   www-bytemark-v4v6.gentoo.org.
www-bytemark-v4v6.gentoo.org. 593 IN   A   89.16.167.134

;; Query time: 18 msec
;; SERVER: 8.8.8.8#53(8.8.8.8)
;; WHEN: Di Aug 13 03:40:57 CEST 2013
;; MSG SIZE  rcvd: 91

The same with the DNS server of my ISP's.
Back to top
View user's profile Send private message
666threesixes666
Veteran
Veteran


Joined: 31 May 2011
Posts: 1248
Location: 42.68n 85.41w

PostPosted: Tue Aug 13, 2013 1:52 am    Post subject: Reply with quote

so then

Code:

/etc/init.d/net.eth0 stop
/etc/init.d/NetworkManager start


stops the resolving? did you turn off dhcp and other net scripts?
Back to top
View user's profile Send private message
Jaglover
Watchman
Watchman


Joined: 29 May 2005
Posts: 8291
Location: Saint Amant, Acadiana

PostPosted: Tue Aug 13, 2013 2:03 am    Post subject: Reply with quote

Just for testing I'd shut down that firewall and see if DNS queries get thru.
_________________
My Gentoo installation notes.
Please learn how to denote units correctly!
Back to top
View user's profile Send private message
cyberpatrol
Apprentice
Apprentice


Joined: 18 Sep 2003
Posts: 161
Location: Germany

PostPosted: Tue Aug 13, 2013 2:24 am    Post subject: Reply with quote

@666threesixes666: Yes. No. I'm not starting dhcpcd manually. It get's started automatically by net.eth0 and NetworkManager.
@Jaglover: No need for shutting down the firewall, it's iptables/netfilter anyway. So I just could open it completely, but since it's only port 53, which is open, this can't be the reason.
Back to top
View user's profile Send private message
Jaglover
Watchman
Watchman


Joined: 29 May 2005
Posts: 8291
Location: Saint Amant, Acadiana

PostPosted: Tue Aug 13, 2013 2:31 am    Post subject: Reply with quote

Right, that's what I meant, open it completely (same as shut it down) and see if the problem goes away.
_________________
My Gentoo installation notes.
Please learn how to denote units correctly!
Back to top
View user's profile Send private message
cyberpatrol
Apprentice
Apprentice


Joined: 18 Sep 2003
Posts: 161
Location: Germany

PostPosted: Tue Aug 13, 2013 2:45 am    Post subject: Reply with quote

That wouldn't change anything since DNS is done over port 53, and this port is already open. Otherwise net.eth0 wouldn't work. It's pretty unlikely that this is a firewall issue.
Back to top
View user's profile Send private message
Jaglover
Watchman
Watchman


Joined: 29 May 2005
Posts: 8291
Location: Saint Amant, Acadiana

PostPosted: Tue Aug 13, 2013 2:53 am    Post subject: Reply with quote

This is basic troubleshooting. You shut down the firewall to see if it is misconfigured. There are services that open an secondary port (as FTP), there are services that use TCP when you don't expect it. I'm trying to help you, eliminate the firewall and see if the problem persists. BTW, don't pay much attention to sixes, she is mostly misfiring.
_________________
My Gentoo installation notes.
Please learn how to denote units correctly!
Back to top
View user's profile Send private message
666threesixes666
Veteran
Veteran


Joined: 31 May 2011
Posts: 1248
Location: 42.68n 85.41w

PostPosted: Tue Aug 13, 2013 2:55 am    Post subject: Reply with quote

id go with what jags saying. rule out the firewall completely. 1 test, 20 seconds...
Back to top
View user's profile Send private message
imaginasys
Tux's lil' helper
Tux's lil' helper


Joined: 26 Dec 2009
Posts: 83
Location: Québec

PostPosted: Tue Aug 13, 2013 2:57 am    Post subject: Reply with quote

can you ping your gateway ? e.g. ping 192.168.1.1 (if you have a router).

do you have a default route to go to the web ? (show output of "route").

I'd suspect incorrect routing.

Regards,
BT :mrgreen:
Back to top
View user's profile Send private message
cyberpatrol
Apprentice
Apprentice


Joined: 18 Sep 2003
Posts: 161
Location: Germany

PostPosted: Tue Aug 13, 2013 4:30 am    Post subject: Reply with quote

I must apologize for the noise and thank you all for your help.

Well, opening the firewall helped indeed, but not the way you meant it. It turned out that I had a simple, and admittedly stupid, syntax error in my firewall script that I recently editied for NetworkManager, and didn't use directly with /etc/init.d/net.eth0, since /etc/init.d/iptables just loads a previously saved ruleset.

I just used some wrong braces for setting a variable with either a parameter or a default value: VAR=$(1:-default) instead of VAR=${1:-default}.

So, problem solved.
Back to top
View user's profile Send private message
imaginasys
Tux's lil' helper
Tux's lil' helper


Joined: 26 Dec 2009
Posts: 83
Location: Québec

PostPosted: Tue Aug 13, 2013 1:24 pm    Post subject: Reply with quote

OK! It happens!

Have fun with Gentoo!
Back to top
View user's profile Send private message
cyberpatrol
Apprentice
Apprentice


Joined: 18 Sep 2003
Posts: 161
Location: Germany

PostPosted: Tue Aug 13, 2013 2:20 pm    Post subject: Reply with quote

Thanks. I'll definitely will have fun with Gentoo, since I had it already for 5 or 6 years and I'm back after about 5 years of using Arch Linux.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Networking & Security All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum