You are not logged in.

#1 2013-10-09 16:50:55

anthillsocial
Member
Registered: 2013-02-18
Posts: 129

[SOLVED] Network connection issues - need to make connections twice

I've a strange issue with my network connection that has recently started to appear where if I:
- Attempt to install a package with pacman.
- Visit a webpage in chromium.
- FTP a file using Thunar.
- SSH into a server.

Then I quite often have to attempt the connection twice i.e:
- Pacman will return "error: failed retrieving file" on a first attempt, but be fine on the second.
- Chromium (or any other browser) will partially load pages or will show a 'Server Not Found' message on the first attempt but be OK after a refresh.
- FTP will not resolve the server on the first attempt but will on the second.
- ssh will return  "Could not resolve hostname Name or service not known" on the first attempt then be fine on the second.

This issue just used to occur with pacman & ssh and I just put it down to 'one of those things I needed to fix when I had time'. Yet the issue has recently started occuring with chromium as well so is making browsing the web a real pain.

I'm at a bit of a loss as to how to track down the issue so would appreciate any tips!

I'm using netctl to connect over wifi & just as I tried to post this message an error appeared in Chromium which may give me some hints as to how to fix this:

The server at bbs.archlinux.org can't be found because the DNS look-up failed. DNS is the network service that translates a website's name to its Internet address. This error is most often caused by having no connection to the Internet or a misconfigured network. It can also be caused by an unresponsive DNS server or a firewall preventing Chromium from accessing the network.

I'm using netcl to connect over wifi.
I also recently installed dhcpd which I occasionally start and stop though the issue with pacman & ssh was occurring before this.

Thanks
Tom

Last edited by anthillsocial (2013-10-14 10:28:48)

Offline

#2 2013-10-09 19:10:52

Nattgew
Member
Registered: 2013-10-09
Posts: 30

Re: [SOLVED] Network connection issues - need to make connections twice

The ssh and Chromium errors indicate that there is some problem with DNS. Your can check /etc/resolv.conf for your DNS settings. To test a DNS lookup you can use the host command:

host www.archlinux.org 8.8.4.4

The 8.8.4.4 is one of Google's DNS server IPs, you can replace that with your own to test. More detail here:
https://wiki.archlinux.org/index.php/Ne … NS_Servers

Offline

#3 2013-10-10 20:05:48

anthillsocial
Member
Registered: 2013-02-18
Posts: 129

Re: [SOLVED] Network connection issues - need to make connections twice

Thanks for the info very helpful. Here's the output of host:

$ host www.archlinux.org 8.8.4.4
------------------------------------
Using domain server:
Name: 8.8.4.4
Address: 8.8.4.4#53
Aliases: 

www.archlinux.org is an alias for gudrun.archlinux.org.
gudrun.archlinux.org has address 66.211.214.131

The content of  /etc/resolv.conf

$ cat /etc/resolv.conf 
-------------------------------------
# Generated by resolvconf
domain home
nameserver 192.168.1.254

And if I change  /etc/resolv.conf  it to:

nameserver 8.8.8.8
nameserver 8.8.4.4

The issue is still occurring - do I need to reload  /etc/resolv.conf somehow?

Offline

#4 2013-10-10 20:52:06

Strike0
Member
From: Germany
Registered: 2011-09-05
Posts: 1,429

Re: [SOLVED] Network connection issues - need to make connections twice

Have a look at

man netctl.profile

You can easily specify the nameservers there. That way they will be the consistently active ones. If you manually overwrite the file, it may get overwritten again by a service. Restarting dhcpcd should not be helpful, unless the link goes down. Try to ping your router fine when the issue occurs.

Offline

#5 2013-10-11 13:53:51

anthillsocial
Member
Registered: 2013-02-18
Posts: 129

Re: [SOLVED] Network connection issues - need to make connections twice

Thanks for that Strike0. It prompted a thorough reading of a number of man pages, though while I 'think' I understand the general concept of how things should be working, I'm finding the configuration confusing!!

I created and added some nameserver settings to the following config file '/etc/resolv.conf.head'  (googles 8.8.8.8 and 8.8.4.4 also work):

$ vim /etc/resolv.conf.head
-----------------------------------------
# OpenDNS servers
nameserver 208.67.222.222
nameserver 208.67.220.220

Then I reload  /etc/resolv.conf and view its new content:

$ resolvconf -u;cat /etc/resolv.conf 
----------------------------------------------------
# Generated by resolvconf
# OpenDNS servers
nameserver 208.67.222.222
nameserver 208.67.220.220
domain home
nameserver 192.168.1.254

And this seems to make everything work, where network connection are being reached after the first attempt!! smile

Though I'm confused why 192.168.1.254 is being used? Am I right in understanding that 192.168.1.254 is a broadcast address so all network devices on 192.168.1.* are being queried for a DNS server? If I use the host command on 192.168.1.254 it seems to fail.  Does this fail mean that my home router is not working correctly or theres' an internal config issue?

$ host www.archlinux.org 192.168.1.254
--------------------------------------------------------------
Using domain server:
Name: 192.168.1.254
Address: 192.168.1.254#53
Aliases: 

www.archlinux.org is an alias for gudrun.archlinux.org.
gudrun.archlinux.org has address 66.211.214.131
Host gudrun.archlinux.org.home not found: 2(SERVFAIL)

What does the "Host gudrun.archlinux.org.home not found: 2(SERVFAIL)" output mean? Where is it getting the .home name from?

As comparison

$ host www.archlinux.org 8.8.4.4
-----------------------------------------------------------------
Using domain server:
Name: 8.8.4.4
Address: 8.8.4.4#53
Aliases: 

www.archlinux.org is an alias for gudrun.archlinux.org.
gudrun.archlinux.org has address 66.211.214.131

In one of the man pages I saw that you can test an internal DNS with:

$ host www.archlinux.org 127.0.0.1
-------------------------------------------------
;; connection timed out; no servers could be reached

Though wouldn't a dhcpd4.service need to be running for that to work?

Lots of questions I know, but I would like to understand exactly what's happening so I can easily trouble shoot in the future.
Tom

Last edited by anthillsocial (2013-10-11 13:55:30)

Offline

#6 2013-10-11 15:04:29

cris9288
Member
Registered: 2013-01-07
Posts: 348

Re: [SOLVED] Network connection issues - need to make connections twice

192.168.1.254 sounds like your gateway address. If I remember correctly, 192.168.1.255 should be the broadcast address because 255 == 11111111 and an OR between that and any other address on the network would return true.

I believe that the gateway is used as a nameserver to resolve host names on the LAN since the router has knowledge of all connected devices. Using the host command on that address probably fails because your  router does not have a host name mapped to its network address. This should be normal.

it makes sense for gudrun.archlinux.org.home to fail since I'm assuming it's not on your domain (from your resolv.conf I can see that your domain is "home"). www.archlinux.org is a valid hostname and the DNS 8.8.4.4 knows how to resolve that address. Again, makes sense to me.

For your last command, you have specified 127.0.0.1 as the dns server you would like to query to resolve www.archlinux.org to an IP address. If there is not a DNS server located at that address then the command will fail.

I hope I haven't given incorrect information, but that is how I understand these things. Hopefully someone can correct me if need be.

Offline

#7 2013-10-11 16:32:58

anthillsocial
Member
Registered: 2013-02-18
Posts: 129

Re: [SOLVED] Network connection issues - need to make connections twice

Thanks for that, its making things a bit clearer.

RE: 192.168.1.254 sounds like your gateway address and 192.168.1.255 should be the broadcast address .
Ahh yes, of course.

RE:  from your resolv.conf I can see that your domain is "home".
Thats one of the bits I don't understand, what do you mean my domain is 'home'? Where is that set? DId I specify that at some point & have I forgotten where?

RE: If there is not a DNS server located at that address then the command will fail.
Ok that makes sense. If I am understanding correctly then by default arch linux doesn't have a DNS server - it doesn't need one as (in my case) the wifi router will have a DNS server to resolve all network devices on the local network. Its only when arch acts as a router, such as when a wifi internet connection is shared over ethernet that a local DNS server might come in useful.

That just leaves me asking the question, why have I suddenly had to specify an OpenDNS or Google DNS server in order for my laptop to resolve hostnames correctly, when it has never needed it before?
Would my router have previously been responsible for defining an external DNS server?

Offline

#8 2013-10-11 18:32:52

cris9288
Member
Registered: 2013-01-07
Posts: 348

Re: [SOLVED] Network connection issues - need to make connections twice

anthillsocial wrote:

Thanks for that, its making things a bit clearer.

RE:  from your resolv.conf I can see that your domain is "home".
Thats one of the bits I don't understand, what do you mean my domain is 'home'? Where is that set? DId I specify that at some point & have I forgotten where?

It was in the output you posted from this command

# resolvconf -u; cat /etc/resolv.conf

That just leaves me asking the question, why have I suddenly had to specify an OpenDNS or Google DNS server in order for my laptop to resolve hostnames correctly, when it has never needed it before?
Would my router have previously been responsible for defining an external DNS server?

That's a good question and I'm not totally sure I know the answer. What does your /etc/resolveconf.conf look like? I remember I had a problem similar to this where the 8.8.8.8 DNS server wasn't in my resolv.conf. This is what it looks like now:

% cat /etc/resolv.conf
# Generated by resolvconf
nameserver 192.168.0.1
nameserver 205.171.2.25
 

and I've never had to mess with it. Have you changed around any settings in your router? In my router configuration, two DNS servers are set: the first is my gateway and the second is the 205.171.2.25. Presumably, that is my ISP's DNS server or something along those lines. This should all be set by default as far as I know.

Offline

#9 2013-10-11 20:10:53

Strike0
Member
From: Germany
Registered: 2011-09-05
Posts: 1,429

Re: [SOLVED] Network connection issues - need to make connections twice

Yes, l agree to crhis9288. Check your router config. The way it works, the router acts as an resolver for DNS on 192*.254, passing on the queries to DNS servers (defined by the ISP probably). Issues like you had them can appear when the router is busy with something (e.g. wifi hickups or a background torrent, whatever) or when the DNS config has a problem. That DNS config may either come from the ISP (when you turn it on it logs into DSL and by that acquires the DNS servers to contact upstream) or by configuration. Check in your case. Circumventing the router like you did with opendns in your client config, is usually better (faster) anyway.

Offline

#10 2013-10-14 10:28:33

anthillsocial
Member
Registered: 2013-02-18
Posts: 129

Re: [SOLVED] Network connection issues - need to make connections twice

RE: Check your router config.
Have just checked the router and it looks like its not passing on DNS queries to the ISP DNS servers, hence the DNS failing. Thanks for all the input as it looks like I've tracked down the culprit & have understood the black art of networking that little bit more smile

Though there's a tiny bit more to understand:

anthillsocial wrote:
Thanks for that, its making things a bit clearer.
RE:  from your resolv.conf I can see that your domain is "home".
Thats one of the bits I don't understand, what do you mean my domain is 'home'? Where is that set? DId I specify that at some point & have I forgotten where?

cris9288 wrote:
It was in the output you posted from this command

RE: It was in the output you posted from this command
Thats my point. /etc/resolv.conf is autogenerated so I'm not sure where it gets "domain home" from?

[EDIT] I've just worked it out. I access my home router via "bthomehub.home" so the router must be defining it in some way.

Offline

Board footer

Powered by FluxBB