LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 09-04-2021, 12:41 PM   #1
JPru
LQ Newbie
 
Registered: Aug 2021
Location: VA
Distribution: Ubuntu 20.04
Posts: 7

Rep: Reputation: Disabled
Home wifi connects, other networks do not


Hi LQ:

I have been running Ubuntu 18.04/20.04 for just over a year without any noticeable problems. I work in a busy environment that hasn't allowed me time to learn anything more than the most basic aspects of Ubuntu, and I have just found an issue that requires help to resolve.

My problem:
Wifi works fine from my home, but when I try to connect to a different network, either private or public, the wifi area of the notification bar says it is connected but I can't connect to any sites. I get a variety of error messages in the browser. The most frequent message is that the host connection cannot be resolved.

What I've tried:
1. A coworker who uses Ubuntu suggested upgrading from 18.04 to 20.04. I did this, but the problem was not resolved.
2. The same coworker suggested that I test my wifi by creating a bootable USB via Unetbootin. I did this, booted into a clean install of Ubuntu 20.04, and found that the problem is resolved. While this shows that my current installation has problems, my work environment can't be interrupted to rebuild my OS.

I need to find a way to resolve this networking issue without the need to perform a full replacement of the OS.

Thanks for the help!

JP
 
Old 09-04-2021, 12:54 PM   #2
computersavvy
Senior Member
 
Registered: Aug 2016
Posts: 3,343

Rep: Reputation: 1484Reputation: 1484Reputation: 1484Reputation: 1484Reputation: 1484Reputation: 1484Reputation: 1484Reputation: 1484Reputation: 1484Reputation: 1484
The first thing to do is try from the command line to ping to something on the internet. Something like "ping -c 4 8.8.8.8" should give you 4 return packets.
Try it again with "ping -c 4 google.com"

If the first one works then you are most definitely connected.
If the second works then there is no problem, but if it fails then the issue is likely in how your system is resolving dns.

The fact that it works when booted to the live image already points to resolving host names, but the ping will confirm that.

What is in /etc/resolv.conf? Post the output of "cat /etc/resolv.conf"

What do you see if you run "dig google.com"? Post the output.

Last edited by computersavvy; 09-05-2021 at 06:21 PM.
 
1 members found this post helpful.
Old 09-05-2021, 09:11 AM   #3
JPru
LQ Newbie
 
Registered: Aug 2021
Location: VA
Distribution: Ubuntu 20.04
Posts: 7

Original Poster
Rep: Reputation: Disabled
Thanks for the quick reply, Computersavvy!
I'll test your suggestions as soon as I can and post the requested results.
FYI: My access to networks other than my working one will be less frequent in the coming week, so it may be a few days before I post again.
JP
 
Old 09-13-2021, 11:01 AM   #4
JPru
LQ Newbie
 
Registered: Aug 2021
Location: VA
Distribution: Ubuntu 20.04
Posts: 7

Original Poster
Rep: Reputation: Disabled
I've run the Ping and Dig commands. Output shown below:

:~$ ping -c 4 8.8.8.8
PINT 8.8.8.8 (8.8.8.8) 56(84) bytes of data.
64 bytes from 8.8.8.8: icmp_seq=1 ttl=114 time=658 ms
64 bytes from 8.8.8.8: icmp_seq=2 ttl=114 time=614 ms
64 bytes from 8.8.8.8: icmp_seq=3 ttl=114 time=613 ms
64 bytes from 8.8.8.8: icmp_seq=4 ttl=114 time=611 ms

--- 8.8.8.8 print statistics ---
4 packets transmitted, 4 received, 0% packet loss, time 3005ms
rtt min/avg/max/mdev = 611.017/623.919/657.635/19.501 ms

:~ping -c 4 google.com
ping: google.com: Name or service not known


I tried running "cat /etc/resolv.conf", but got the message:
cat: /etc/resolv.conf: No such file or directory


:~$ dig google.com
; <<>> DiG 9.16.1-Ubuntu <<>> google.com
;; global options: +cmd
;; Got answer:
;; ->>HEADER>>- opcode: QUERY, status: SERVFAIL, id: 13458
;; flags: qr rd ra; QUERY: 1, ANSWER: 0, AUTHORITY: 0, ADDITIONAL: 1

;;OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 4096
; COOKIE: e7a0768532a84fc301000000613f4310c1c7982f598a1684 (good)
;; QUESTION SECTION:
;google.com. IN A

;; Query time: 76 msec
;; SERVER: ::1#53(::1).
;; WHEN: Mon Sep 13 08:24:48 EDT 2021
;; MSG SIZE rcvd: 67


I also tried connection to a different wifi, one that requires login. The browser tried to open a login page, by instead showed:

"Hmm. We're having trouble finding that site.
We can't connect to the server at n38.network-auth.com."


Thanks for the help,
JPru
 
Old 09-13-2021, 12:31 PM   #5
Timothy Miller
Moderator
 
Registered: Feb 2003
Location: Arizona, USA
Distribution: Debian, EndeavourOS, OpenSUSE, KDE Neon
Posts: 4,003
Blog Entries: 26

Rep: Reputation: 1521Reputation: 1521Reputation: 1521Reputation: 1521Reputation: 1521Reputation: 1521Reputation: 1521Reputation: 1521Reputation: 1521Reputation: 1521Reputation: 1521
Quote:
Originally Posted by JPru View Post
I tried running "cat /etc/resolv.conf", but got the message:
cat: /etc/resolv.conf: No such file or directory

So that can definitely be an issue. For 20.04, by default the file should be a link to the systemd file, try running this and restarting:


Code:
sudo ln -s /run/systemd/resolve/stub-resolv.conf /etc/resolv.conf
 
Old 09-15-2021, 11:41 AM   #6
JPru
LQ Newbie
 
Registered: Aug 2021
Location: VA
Distribution: Ubuntu 20.04
Posts: 7

Original Poster
Rep: Reputation: Disabled
In my 9/13 post, the CAT command reported the resolv.conf file as not existing, however when I tried creating the link via the LN command, I got this response:

ln: Failed to create symbolic link '/etc/resolv.conf': File exists
 
Old 09-15-2021, 06:06 PM   #7
computersavvy
Senior Member
 
Registered: Aug 2016
Posts: 3,343

Rep: Reputation: 1484Reputation: 1484Reputation: 1484Reputation: 1484Reputation: 1484Reputation: 1484Reputation: 1484Reputation: 1484Reputation: 1484Reputation: 1484
Try doing an "ls -l /etc/resolv.conf" to confirm it does exist and verify it is functional link. What you should see is something like
Code:
# ls -l /etc/resolv.conf
lrwxrwxrwx. 1 root root 39 Dec 11  2020 /etc/resolv.conf -> ../run/systemd/resolve/stub-resolv.conf
If the /etc/resolve.conf part of that line is green then it is working as it should. If it is red then the link is broken.

If broken then you will need to find out why the file /run/systemd/resolve/stub-resolv.conf is not present/readable.

Please post the output of both the ls command above and "cat /run/systemd/resolve/stub-resolv.conf"

Last edited by computersavvy; 09-15-2021 at 06:08 PM.
 
Old 09-16-2021, 06:07 PM   #8
JPru
LQ Newbie
 
Registered: Aug 2021
Location: VA
Distribution: Ubuntu 20.04
Posts: 7

Original Poster
Rep: Reputation: Disabled
The results of ls -l /etc/resolv.conf:
lrwxrwxrwx 1 root root 27 Jul 28 2020 /etc/resolv.conf -> /run/resolvconf/resolv.conf

both the "/etc/resolv.conf" and "/run/resolvconf/resolv.conf" are in red text on a grey background.


The results of cat /run/systemd/resolve/stub-resolv.conf:
cat: /run/systemd/resolve/stub-resolv.conf: No such file or directory
 
Old 09-17-2021, 10:34 AM   #9
computersavvy
Senior Member
 
Registered: Aug 2016
Posts: 3,343

Rep: Reputation: 1484Reputation: 1484Reputation: 1484Reputation: 1484Reputation: 1484Reputation: 1484Reputation: 1484Reputation: 1484Reputation: 1484Reputation: 1484
Quote:
Originally Posted by JPru View Post
The results of ls -l /etc/resolv.conf:
lrwxrwxrwx 1 root root 27 Jul 28 2020 /etc/resolv.conf -> /run/resolvconf/resolv.conf

both the "/etc/resolv.conf" and "/run/resolvconf/resolv.conf" are in red text on a grey background.


The results of cat /run/systemd/resolve/stub-resolv.conf:
cat: /run/systemd/resolve/stub-resolv.conf: No such file or directory
This seems to be your problem. Somehow systemd & resolved are not properly populating that file so you have no functional dns.

Try "systemctl status systemd-resolved.service" and post the output.

Also, please use code tags when you post the output of commands so we can see it exactly as formatted on your screen.
 
Old 09-20-2021, 09:47 PM   #10
JPru
LQ Newbie
 
Registered: Aug 2021
Location: VA
Distribution: Ubuntu 20.04
Posts: 7

Original Poster
Rep: Reputation: Disabled
Here are the results of systemctl status systemd-resolved.service:

Code:
● systemd-resolved.service - Network Name Resolution
     Loaded: loaded (/lib/systemd/system/systemd-resolved.service; disabled; vendor preset: enabled)
     Active: inactive (dead)
       Docs: man:systemd-resolved.service(8)
             https://www.freedesktop.org/wiki/Software/systemd/resolved
             https://www.freedesktop.org/wiki/Software/systemd/writing-network-configuration-managers
             https://www.freedesktop.org/wiki/Software/systemd/writing-resolver-clients
 
Old 10-01-2021, 06:27 AM   #11
JPru
LQ Newbie
 
Registered: Aug 2021
Location: VA
Distribution: Ubuntu 20.04
Posts: 7

Original Poster
Rep: Reputation: Disabled
Home wifi connects, other networks do not - Resolved, not solved

Hi all:
Sorry for the long delay in responding. My company has given me another laptop to work from so the one with problems could be entirely rebuilt with Ubuntu 20.10. All is now working correctly on all networks.
Thanks for all the help!
J
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Don’t go looking for other WiFi networks! taylorkh Linux - Networking 10 08-07-2017 03:41 AM
other computers on networks with windows, see other computers knightnet Linux - Newbie 3 03-28-2017 02:56 PM
Simple VPN to link my home network to my father's and fiancees home networks christiansacks Linux - Networking 3 09-14-2012 01:55 PM
USB WiFi / Ubuntu 9.04 / Connects to non-secure networks but not WEP/WPA FastFeet Linux - Wireless Networking 6 05-22-2009 03:57 AM
WiFi Only Connects Using Shell, GUI Fails on Fiesty 7.04 / Dell 1350 WiFi Card pr0gr4mm3r Linux - Wireless Networking 1 07-10-2007 08:43 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 09:15 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration