0

The Issue

I am a web developer so basically a newbie at networking. I am working on a kiosk application which requires to start a chromium browser loading another web page which is not being served locally. So if it's dynamic everything works just fine but on static ip nothing works

Model           : Raspberry Pi 3 Model B Rev 1.2  

==================================================================
uname -a
==================================================================
Linux raspberrypi 4.19.93-v7+ #1290 SMP Fri Jan 10 16:39:50 GMT 2020 armv7l                 
GNU/Linux

=======================================================================
cat /etc/os-release
=======================================================================
PRETTY_NAME="Raspbian GNU/Linux 10 (buster)"
NAME="Raspbian GNU/Linux"
VERSION_ID="10"
VERSION="10 (buster)"
VERSION_CODENAME=buster
ID=raspbian
ID_LIKE=debian
HOME_URL="http://www.raspbian.org/"
SUPPORT_URL="http://www.raspbian.org/RaspbianForums"
BUG_REPORT_URL="http://www.raspbian.org/RaspbianBugs"

When on static IP

I can ping any ip address whether local or not, SSH into my rpi, and use FTP via my IDE which is visual code and it uploads files folders you name it!

I have tried giving it multiple dns as static domain_name_servers but still nothing

==================================================================
Settings for static ip at /etc/dhcpcd.conf
===================================================================
interface eth0
static ip_address=192.168.0.253/24
static routers=192.168.0.1
static domain_name=204.92.15.211

==================================================================
ifconfig
===================================================================
eth0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
    inet 192.168.0.253  netmask 255.255.255.0  broadcast 192.168.0.255
    inet6 fd00:fc:8d77:9032:63c0:ff96:ec1c:21aa  prefixlen 64  scopeid     
0x0<global>
    inet6 fe80::9896:372:d041:417e  prefixlen 64  scopeid 0x20<link>
    ether b8:27:eb:1d:e6:29  txqueuelen 1000  (Ethernet)
    RX packets 198  bytes 20566 (20.0 KiB)
    RX errors 0  dropped 0  overruns 0  frame 0
    TX packets 139  bytes 20235 (19.7 KiB)
    TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

===================================================================
ip -4 route show
===================================================================
default via 192.168.0.1 dev eth0 src 192.168.0.253 metric 202
192.168.0.0/24 dev eth0 proto dhcp scope link src 192.168.0.253 metric 202

=====================================================================
ip -4 addr show
=====================================================================
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
    inet 127.0.0.1/8 scope host lo
       valid_lft forever preferred_lft forever
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000
    inet 192.168.0.253/24 brd 192.168.0.255 scope global noprefixroute eth0
       valid_lft forever preferred_lft forever      

When on Dynamic

Everything works just fine

==========================================
ifconfig
==========================================
eth0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 192.168.0.20  netmask 255.255.255.0  broadcast 192.168.0.255
        inet6 fe80::9896:372:d041:417e  prefixlen 64  scopeid 0x20<link>
        inet6 fd00:fc:8d77:9032:63c0:ff96:ec1c:21aa  prefixlen 64  scopeid 0x0<global>
        ether b8:27:eb:1d:e6:29  txqueuelen 1000  (Ethernet)
        RX packets 997  bytes 368526 (359.8 KiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 686  bytes 96921 (94.6 KiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

==========================================
ip -4 route show
==========================================
default via 192.168.0.1 dev eth0 proto dhcp src 192.168.0.20 metric 202
192.168.0.0/24 dev eth0 proto dhcp scope link src 192.168.0.20 metric 202

==========================================
ip -4 addr show
==========================================
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
    inet 127.0.0.1/8 scope host lo
       valid_lft forever preferred_lft forever
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000
    inet 192.168.0.20/24 brd 192.168.0.255 scope global dynamic noprefixroute eth0
       valid_lft 604415sec preferred_lft 528815sec

Also tried

I tried changing mtu 1500 to mtu 1400 still no results.

Please let me know if you need any further information regarding this

Mani
  • 111
  • 5
  • 1
    What's the exact problem? If the problem is with the DNS server as you can't update the raspbian because of this Temporary failure resolving 'raspbian.raspberrypi.org' error, you should be concerned about the /etc/resolv/conf file. I mean, check the nameservers (which is the DNS server) there. However, if you wanna a temporary solution, comment all lines there and add nameserver 4.2.2.4 then ping archive.raspberrypi.org. You should see the echo reply. Of course, the raspberry pi must get echo reply on ping 4.2.2.4 if you wish this solution works. – M. Rostami Jan 26 '20 at 19:40
  • 1
    I this case, the primary solution is: Add the static domain_name_servers=4.2.2.4 at the end of this /etc/dhcpcd.conf file. Please inform the result then I'll make answer these comments. – M. Rostami Jan 26 '20 at 19:44
  • 1
    "So if it's dynamic everything works just fine but on static ip nothing works" So why try and set a static address? You haven't even used the correct parameters. If you REALLY must see How to set up Static IP Address – Milliways Jan 27 '20 at 00:44
  • @M.Rostami It's not just it cannot resolve archive.raspberrypi.org it's not resolving anything. I am going to test out my DNS server and see if that's causing the issues. – Mani Jan 27 '20 at 16:58
  • 1
    @Milliways In terms of parameters if you're talking about the domain_name then please read the question carefully otherwise according to the link you provided I am following the dhcpcd.conf approach. – Mani Jan 27 '20 at 17:00
  • 1
    @Mani It's not a solution for just archive.raspberrypi.org domain. I realized that the DNS server might be the problem. Alright. – M. Rostami Jan 27 '20 at 20:27
  • The whole point is you DID NOT specify a DNS (i.e. you DID NOT follow the link) so it is hardly a surprise it doesn't work. – Milliways Jan 27 '20 at 21:08
  • @M.Rostami Thanks a ton. It is now working, the issue was with my ISP provided DNS server ip address. Please answer the question so I can accept it. As soon as I tried 4.2.2.4 it worked. Appreciate it! Info on /etc/resolv.conf was really helpful – Mani Jan 28 '20 at 02:46
  • @Milliways For you SIR "I have tried giving it multiple dns as static domain_name_servers but still nothing" YOU DEFINITELY DIDN'T READ THAT STATEMENT. – Mani Jan 28 '20 at 02:49

1 Answers1

1

If the problem is with the DNS server as you can't update the raspbian because of this Temporary failure resolving 'raspbian.raspberrypi.org' error, you should be concerned about the /etc/resolv.conf file. I mean, check the nameservers (which is the DNS server) there.

However, if you want a temporary solution, make comment (by adding #) all lines there and add nameserver 4.2.2.4 then ping archive.raspberrypi.org (It's not a solution for just archive.raspberrypi.org domain. I realized that the DNS server might be the problem. Alright.).
You should see the echo reply. Of course, the raspberry pi must get echo reply on ping 4.2.2.4 if you wish this solution works.

I this case, the primary solution is:
Add the static domain_name_servers=4.2.2.4 at the end of this /etc/dhcpcd.conf file.

M. Rostami
  • 4,323
  • 1
  • 17
  • 36