yjl
Posts: 21
Joined: Sun Aug 06, 2017 7:53 pm

Unable to update Rpi in China, DNS issue?

Thu May 17, 2018 4:38 am

Hi,

Somehow I am working on my project with Rpi zero in China. I have no experience with Chinese network environment but I know some major sites such as google, facebook, youtube are blocked officially. Instead I can use VPN service.

now I have an issue with downloading packages or update.

Code: Select all

Sudo apt-get update
gives back

Code: Select all

temporary failure resolving 'raspbian.raspberrypi.org' 
I tried to follow below solution, but no luck.

Code: Select all

sudo nano /etc/resolv.conf
nameserver 8.8.8.8
nameserver 8.8.4.4


What I found so far is that,

Code: Select all

ping google.com
doesn't work on a command line. (even when I use VPN services). Anyone could help me?

User avatar
rpdom
Posts: 12649
Joined: Sun May 06, 2012 5:17 am
Location: Ankh-Morpork

Re: Unable to update Rpi in China, DNS issue?

Thu May 17, 2018 5:37 am

Does "ping 8.8.8.8" work? If not, I suspect Google's DNS is being blocked too. Try one of the other DNS services, like OpenDNS and see if that works, otherwise try and route DNS via your VPN and your local system.

yjl
Posts: 21
Joined: Sun Aug 06, 2017 7:53 pm

Re: Unable to update Rpi in China, DNS issue?

Thu May 17, 2018 5:52 am

[Updated]

My Pi is connected by 5pin data cable through RNDIS. Could it be a problem? Terminal works fine though..
I tried to use mirror in China, but still no luck.

Code: Select all

sudo nano /etc/apt/sources.list

Code: Select all

deb https://mirrors.cqu.edu.cn/raspbian/raspbian/ stretch main contrib non-free rpi

Code: Select all

sudo apt-get update
Err:1 https://mirrors.cqu.edu.cn/raspbian/raspbian stretch InRelease
  Could not resolve host: mirrors.cqu.edu.cn
Reading package lists... Done
W: Failed to fetch https://mirrors.cqu.edu.cn/raspbian/raspbian/dists/stretch/InRelease  Could not resolve host: mirrors.cqu.edu.cn
W: Some index files failed to download. They have been ignored, or old ones used instead.
W: Target Packages (main/binary-armhf/Packages) is configured multiple times in /etc/apt/sources.list:4 and /etc/apt/sources.list.d/raspi.list:4
W: Target Packages (main/binary-all/Packages) is configured multiple times in /etc/apt/sources.list:4 and /etc/apt/sources.list.d/raspi.list:4
W: Target Translations (main/i18n/Translation-en_GB) is configured multiple times in /etc/apt/sources.list:4 and /etc/apt/sources.list.d/raspi.list:4
W: Target Translations (main/i18n/Translation-en) is configured multiple times in /etc/apt/sources.list:4 and /etc/apt/sources.list.d/raspi.list:4
Any idea would be appreciated. thanks

yjl
Posts: 21
Joined: Sun Aug 06, 2017 7:53 pm

Re: Unable to update Rpi in China, DNS issue?

Thu May 17, 2018 6:13 am

rpdom wrote:
Thu May 17, 2018 5:37 am
Does "ping 8.8.8.8" work? If not, I suspect Google's DNS is being blocked too. Try one of the other DNS services, like OpenDNS and see if that works, otherwise try and route DNS via your VPN and your local system.
Hi rpdom, thanks for the comment,

I tried "ping 8.8.8.8" / 4.4.4.4 and it works. But when I do "ping google.com" it doesn't work.
I found the list of mirrors in China thus I assume people use Rpi here anyhow..

User avatar
rpdom
Posts: 12649
Joined: Sun May 06, 2012 5:17 am
Location: Ankh-Morpork

Re: Unable to update Rpi in China, DNS issue?

Thu May 17, 2018 6:15 am

It's definitely a DNS issue then, whether because it is being blocked, or for some other reason.

yjl
Posts: 21
Joined: Sun Aug 06, 2017 7:53 pm

Re: Unable to update Rpi in China, DNS issue?

Thu May 17, 2018 6:46 am

rpdom wrote:
Thu May 17, 2018 6:15 am
It's definitely a DNS issue then, whether because it is being blocked, or for some other reason.
That sounds like bad news.

I've noticed one more thing. As I found some advice from other post suggesting to correct time zone. But somehow now I can't approach raspi-config timezone menu,
There was an error running option I2 Change Timezone
Literally Pi zero (stretch lite) has be installed and I couldn't do anything (even update/upgarde) except that I changed its timezone to Hongkong. Now I can't change it again.

Is it possible? or is it also dns relevant trouble? :oops:

yjl
Posts: 21
Joined: Sun Aug 06, 2017 7:53 pm

Re: Unable to update Rpi in China, DNS issue?

Thu May 17, 2018 8:04 am

: Update

1.
I formatted SD card, re-installed Raspbian stretch-lite(4/16) for Zero. My Rpi is headless and connected by 5pin cable to USB / RNDIS.
I am using UK VPN optional (On/Off)

2.
Except enable 'ssh', nothing has been changed. Tried 'Sudo apt-get update'
Doesn't work.

3.
I followed instruction to fix Rpi IP. It successfully changed. Now Rpi's Ip is '192.168.10.2' Tried 'Sudo apt-get update'
Doesn't work.

4.
Tried ping on ssh. 'Ping 8.8.8.8' , doesn't work.

It seems definitely DNS issue but I have no idea how to approach. Any advice please?

User avatar
DougieLawson
Posts: 33322
Joined: Sun Jun 16, 2013 11:19 pm
Location: Basingstoke, UK
Contact: Website

Re: Unable to update Rpi in China, DNS issue?

Thu May 17, 2018 8:33 am

How do you know your VPN is working? Can you ping bbc.co.uk? Can you browse to http://bbc.co.uk/news ?
Microprocessor, Raspberry Pi & Arduino Hacker
Mainframe database troubleshooter
MQTT Evangelist
Twitter: @DougieLawson

2012-18: 1B*5, 2B*2, B+, A+, Z, ZW, 3Bs*3, 3B+

Any DMs sent on Twitter will be answered next month.

yjl
Posts: 21
Joined: Sun Aug 06, 2017 7:53 pm

Re: Unable to update Rpi in China, DNS issue?

Thu May 17, 2018 9:37 am

Spent a half day with this trouble, problem solve but I am not sure if it is completely cleared.

1.
I did re-format my micro SD again,
also reset all the network setting as fab initialized.

2.
After remounted raspbian image into SD,
started to set fixed Rpi IP / DNS / Gateway
also set again network bridge between laptop-Rpi.

3.
Added nameserver 8.8.8.8 / 8.8.4.4

4.
used mirror site one of nearby location. https://www.raspbian.org/RaspbianMirrors
Now it works! Somehow I assume it was DNS related problem but honestly I have no idea, what was wrong.
Mirroring site works well and VPN works fine as well simultaneously. (I can access bbc iplayer)

5.
ping works well even with 8.8.8.8 (google)
But I don't dare tried to change timezone, yet.

Thanks for the comment, and it helped me at least to go proper way. I appreciate it!!

User avatar
HawaiianPi
Posts: 2486
Joined: Mon Apr 08, 2013 4:53 am
Location: Aloha, Oregon USA

Re: Unable to update Rpi in China, DNS issue?

Thu May 17, 2018 10:18 am

If you know google is blocked, why use google DNS?

Try Cloudflare

1.1.1.1
1.0.0.1

or OpenDNS

208.67.222.222
208.67.220.220

yjl wrote:
Thu May 17, 2018 5:52 am
My Pi is connected by 5pin data cable through RNDIS.
It sounds like you are using your Pi Zero in USB Gadget mode, so how is it connected to the net?
My mind is like a browser. 27 tabs are open, 9 aren't responding,
lots of pop-ups...and where is that annoying music coming from?

Return to “Troubleshooting”

Who is online

Users browsing this forum: arkader and 26 guests