Public dns is not working on centos 8

Issues related to configuring your network
Post Reply
naveena21
Posts: 2
Joined: 2020/02/08 16:42:22

Public dns is not working on centos 8

Post by naveena21 » 2020/02/08 16:53:28

[root@workstation network-scripts]# ping google.com
ping: google.com: Name or service not known
---------------------------------------------------------------------------------------------------------------------------
[root@workstation network-scripts]# date;cat ifcfg-ens33
Sat Feb 8 11:47:26 EST 2020
TYPE=Ethernet
BOOTP
ROTO=static
ONBOOT=yes
IPADDR=192.168.2.50
NETMASK=255.255.255.0
GATEWAY=192.168.2.1
DNS1=8.8.8.8
DNS2=8.8.4.4

[root@workstation network-scripts]# date; cat /etc/resolv.conf
Sat Feb 8 11:48:00 EST 2020
# Generated by NetworkManager
nameserver 8.8.8.8
nameserver 8.8.4.4

root@workstation network-scripts]# date; ip a show ens33
Sat Feb 8 11:48:54 EST 2020
2: ens33: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP group default qlen 1000
link/ether 00:0c:29:5e:20:07 brd ff:ff:ff:ff:ff:ff
inet 192.168.2.50/24 brd 192.168.2.255 scope global noprefixroute ens33
valid_lft forever preferred_lft forever
[root@workstation network-scripts]#
---------------------------------------------------------------------------------------------------------------------------
Please help me in fixing this issue!!!!

hunter86_bg
Posts: 2007
Joined: 2015/02/17 15:14:33
Location: Bulgaria
Contact:

Re: Public dns is not working on centos 8

Post by hunter86_bg » 2020/02/08 23:35:12

Check /etc/nsswitch.conf for the order of dna.
Then verify dns settings for NetworkManager's network profile.
Also verify that you have a route to reach the 2 DNS servers.

naveena21
Posts: 2
Joined: 2020/02/08 16:42:22

Re: Public dns is not working on centos 8

Post by naveena21 » 2020/02/09 07:21:48

[root@workstation ~]# cat /etc/nsswitch.conf | grep dns
# hosts: files dns
# hosts: files dns # from user file
# dns Use DNS (Domain Name Service)
#hosts: files dns myhostname ------------------------> Before
hosts: files dns workstation ------------------------> After

----------------------------------------------------------------------------------------------------------------------------------------
root@workstation ~]# route -n
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
0.0.0.0 192.168.2.1 0.0.0.0 UG 100 0 0 ens33
192.168.2.0 0.0.0.0 255.255.255.0 U 100 0 0 ens33
192.168.2.0 192.168.2.1 255.255.255.0 UG 100 0 0 ens33
192.168.122.0 0.0.0.0 255.255.255.0 U 0 0 0 virbr0
[root@workstation ~]#
----------------------------------------------------------------------------------------------------------------------------------------------
[root@workstation ~]# date; cat /etc/resolv.conf
Sun Feb 9 01:38:09 EST 2020
# Generated by NetworkManager
nameserver 192.168.2.1
nameserver 8.8.8.8
nameserver 8.8.4.4
[root@workstation ~]#
-----------------------------------------------------------------------------------------------------------------------------------------
I am using 15 VMPlayer with a network connection in the bridged mode. have assigned the static IP address in the same range as my
current VLAN from the SOHO router. DNS settings and routes are defined. Yet it is not working.
-----------------------------------------------------------------------------------------------------------------------------------------
[root@workstation ~]# cat /etc/sysconfig/network
# Created by anaconda

-----------------------------------------------------------------------------------------------------------------------------------------
[root@workstation ~]# ip route
default via 192.168.2.1 dev ens33 proto static metric 100
192.168.2.0/24 dev ens33 proto kernel scope link src 192.168.2.150 metric 100
192.168.122.0/24 dev virbr0 proto kernel scope link src 192.168.122.1 linkdown
[root@workstation ~]#

User avatar
Errosion
Posts: 38
Joined: 2014/12/03 19:58:02

Re: Public dns is not working on centos 8

Post by Errosion » 2020/02/11 14:44:51

Are you able to ping your gateway?
Are you able to ping 8.8.8.8 or 8.8.4.4?

User avatar
TrevorH
Forum Moderator
Posts: 27727
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

Re: Public dns is not working on centos 8

Post by TrevorH » 2020/02/11 16:05:52

If you're using a static ip address in the same range that VMWare assigns using DHCP then it may be blocking the packets as it doesn't recognise the ip you are using should be allowed. Does it work when using DHCP?
CentOS 6 will die in November 2020 - migrate sooner rather than later!
CentOS 5 has been EOL for nearly 3 years and should no longer be used for anything!
Full time Geek, part time moderator. Use the FAQ Luke

Post Reply

Return to “CentOS 8 - Networking Support”