Page 1 of 1

Public dns is not working on centos 8

Posted: 2020/02/08 16:53:28
by naveena21
[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!!!!

Re: Public dns is not working on centos 8

Posted: 2020/02/08 23:35:12
by hunter86_bg
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.

Re: Public dns is not working on centos 8

Posted: 2020/02/09 07:21:48
by naveena21
[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 ~]#

Re: Public dns is not working on centos 8

Posted: 2020/02/11 14:44:51
by Errosion
Are you able to ping your gateway?
Are you able to ping 8.8.8.8 or 8.8.4.4?

Re: Public dns is not working on centos 8

Posted: 2020/02/11 16:05:52
by TrevorH
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?

Re: Public dns is not working on centos 8

Posted: 2020/02/26 16:58:11
by naveena21
it did work fine with the DHCP only for the first time. I did try using the DHCP option with another new centos8 machine with no luck :x :x :x :x