Routing and "Temporary failure in name resolution" error.

Issues related to configuring your network
Post Reply
hack3rcon
Posts: 757
Joined: 2014/11/24 11:04:37

Routing and "Temporary failure in name resolution" error.

Post by hack3rcon » 2019/07/13 05:38:37

Hello.
My system has two NICs as below:

Code: Select all

# ifconfig
enp0s3: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 10.0.2.15  netmask 255.255.255.0  broadcast 10.0.2.255
        inet6 fe80::a00:27ff:fe79:3b43  prefixlen 64  scopeid 0x20<link>
        ether 08:00:27:79:3b:43  txqueuelen 1000  (Ethernet)
        RX packets 783  bytes 60408 (58.9 KiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 514  bytes 62950 (61.4 KiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

enp0s8: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 192.168.0.2  netmask 255.255.255.0  broadcast 192.168.0.255
        inet6 fe80::a00:27ff:fee6:c57c  prefixlen 64  scopeid 0x20<link>
        ether 08:00:27:e6:c5:7c  txqueuelen 1000  (Ethernet)
        RX packets 136  bytes 14117 (13.7 KiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 777  bytes 49490 (48.3 KiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

lo: flags=73<UP,LOOPBACK,RUNNING>  mtu 65536
        inet 127.0.0.1  netmask 255.0.0.0
        inet6 ::1  prefixlen 128  scopeid 0x10<host>
        loop  txqueuelen 1  (Local Loopback)
        RX packets 696  bytes 66020 (64.4 KiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 696  bytes 66020 (64.4 KiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0
I want my system use "enp0s3" for connect to the internet. I changed my route as below:

Code: Select all

# route
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
default         10.0.2.15       0.0.0.0         UG    0      0        0 enp0s3
default         192.168.0.1     0.0.0.0         UG    0      0        0 enp0s8
default         10.0.2.2        0.0.0.0         UG    100    0        0 enp0s3
10.0.2.0        0.0.0.0         255.255.255.0   U     100    0        0 enp0s3
192.168.0.0     0.0.0.0         255.255.255.0   U     0      0        0 enp0s8
But when I use ping command:

Code: Select all

# ping google.com
ping: google.com: Temporary failure in name resolution
And:

Code: Select all

# traceroute google.com
google.com: Temporary failure in name resolution
Cannot handle "host" cmdline arg `google.com' on position 1 (argc 1)
The "enp0s8" use static IP as below:

Code: Select all

auto enp0s8
iface enp0s8 inet static
    address 192.168.0.2
    netmask 255.255.255.0
    gateway 192.168.0.1
    broadcast 192.168.0.255
And:

Code: Select all

# ip route list
default via 10.0.2.15 dev enp0s3 scope link 
default via 192.168.0.1 dev enp0s8 onlink 
default via 10.0.2.2 dev enp0s3 proto static metric 100 
10.0.2.0/24 dev enp0s3 proto kernel scope link src 10.0.2.15 metric 100 
192.168.0.0/24 dev enp0s8 proto kernel scope link src 192.168.0.2 
How can I solve it?

Thank you.

hack3rcon
Posts: 757
Joined: 2014/11/24 11:04:37

Re: Routing and "Temporary failure in name resolution" error.

Post by hack3rcon » 2019/07/13 10:30:56

I remove below line and problem solved:

Code: Select all

gateway 192.168.0.1

User avatar
jlehtone
Posts: 4523
Joined: 2007/12/11 08:17:33
Location: Finland

Re: Routing and "Temporary failure in name resolution" error.

Post by jlehtone » 2019/07/13 13:22:17

hack3rcon wrote:
2019/07/13 05:38:37

Code: Select all

# ip route list
default via 10.0.2.15 dev enp0s3 scope link 
default via 192.168.0.1 dev enp0s8 onlink 
default via 10.0.2.2 dev enp0s3 proto static metric 100 
10.0.2.0/24 dev enp0s3 proto kernel scope link src 10.0.2.15 metric 100 
192.168.0.0/24 dev enp0s8 proto kernel scope link src 192.168.0.2 
You want to access "google.com". Lets say that its IP address is 8.8.8.8.

Lets check some routing rules:
* The 8.8.8.8 is not within 10.0.2.0/24
* The 8.8.8.8 is not within 192.168.0.0/24

That leaves three rules to check:

Code: Select all

default via 10.0.2.15 dev enp0s3 scope link 
default via 192.168.0.1 dev enp0s8 onlink 
default via 10.0.2.2 dev enp0s3 proto static metric 100
You said that you did remove one of them, so there is still:

Code: Select all

default via 10.0.2.15 dev enp0s3 scope link 
default via 10.0.2.2 dev enp0s3 proto static metric 100
By default, packet to 8.8.8.8 should be delivered to 10.0.2.15.
By default, packet to 8.8.8.8 should be delivered to 10.0.2.2.
How can that be? By definition, default is singular. The default. One rule.

User avatar
TrevorH
Site Admin
Posts: 33202
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

Re: Routing and "Temporary failure in name resolution" error.

Post by TrevorH » 2019/07/13 14:32:33

auto enp0s8
iface enp0s8 inet static
address 192.168.0.2
netmask 255.255.255.0
gateway 192.168.0.1
broadcast 192.168.0.255
This doesn't even look like you are running CentOS. That's a Debian/Ubuntu style network config file, not one from a RHEL based o/s at all.
The future appears to be RHEL or Debian. I think I'm going Debian.
Info for USB installs on http://wiki.centos.org/HowTos/InstallFromUSBkey
CentOS 5 and 6 are deadest, do not use them.
Use the FAQ Luke

hack3rcon
Posts: 757
Joined: 2014/11/24 11:04:37

Re: Routing and "Temporary failure in name resolution" error.

Post by hack3rcon » 2019/07/13 21:02:39

TrevorH wrote:
2019/07/13 14:32:33
auto enp0s8
iface enp0s8 inet static
address 192.168.0.2
netmask 255.255.255.0
gateway 192.168.0.1
broadcast 192.168.0.255
This doesn't even look like you are running CentOS. That's a Debian/Ubuntu style network config file, not one from a RHEL based o/s at all.
Yes, both of them.

hack3rcon
Posts: 757
Joined: 2014/11/24 11:04:37

Re: Routing and "Temporary failure in name resolution" error.

Post by hack3rcon » 2019/07/13 21:04:36

jlehtone wrote:
2019/07/13 13:22:17
hack3rcon wrote:
2019/07/13 05:38:37

Code: Select all

# ip route list
default via 10.0.2.15 dev enp0s3 scope link 
default via 192.168.0.1 dev enp0s8 onlink 
default via 10.0.2.2 dev enp0s3 proto static metric 100 
10.0.2.0/24 dev enp0s3 proto kernel scope link src 10.0.2.15 metric 100 
192.168.0.0/24 dev enp0s8 proto kernel scope link src 192.168.0.2 
You want to access "google.com". Lets say that its IP address is 8.8.8.8.

Lets check some routing rules:
* The 8.8.8.8 is not within 10.0.2.0/24
* The 8.8.8.8 is not within 192.168.0.0/24

That leaves three rules to check:

Code: Select all

default via 10.0.2.15 dev enp0s3 scope link 
default via 192.168.0.1 dev enp0s8 onlink 
default via 10.0.2.2 dev enp0s3 proto static metric 100
You said that you did remove one of them, so there is still:

Code: Select all

default via 10.0.2.15 dev enp0s3 scope link 
default via 10.0.2.2 dev enp0s3 proto static metric 100
By default, packet to 8.8.8.8 should be delivered to 10.0.2.15.
By default, packet to 8.8.8.8 should be delivered to 10.0.2.2.
How can that be? By definition, default is singular. The default. One rule.
I removed "gateway" from mi NIC configuration file and problem solved.

Post Reply