![]() |
I can ping IP but not hostname
Hi,
I have CentOS on virtualbox/ Windows 10. The network setting in the virutalbox is attached to: Bridged Adapter In CentOS i can ping IPs, but not URLs. I tried setting 8.8.8.8 in resolv.conf but no luck. Can you please help me knowing why? Below my config [root@localhost ~]# cat /etc/sysconfig/network-scripts/ifcfg-enp0s3 TYPE=Ethernet PROXY_METHOD=none BROWSER_ONLY=no BOOTPROTO=dhcp DEFROUTE=yes IPV4_FAILURE_FATAL=no IPV6INIT=no IPV6_AUTOCONF=yes IPV6_DEFROUTE=yes IPV6_FAILURE_FATAL=no IPV6_ADDR_GEN_MODE=stable-privacy NAME=enp0s3 UUID=04f8aba5-ee9f-425e-9333-4c9ed58b4d9b DEVICE=enp0s3 ONBOOT=yes [root@localhost ~]# cat /etc/resolv.conf # Generated by NetworkManager nameserver 172.21.1.1 -----> IP address of my router [root@localhost ~]# [root@localhost ~]# cat /etc/hosts 127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4 ::1 localhost localhost.localdomain localhost6 localhost6.localdomain6 [root@localhost ~]# [root@localhost ~]# iptables -L Chain INPUT (policy ACCEPT) target prot opt source destination Chain FORWARD (policy ACCEPT) target prot opt source destination Chain OUTPUT (policy ACCEPT) target prot opt source destination [root@localhost ~]# Thanks, |
/etc/resolv.conf should contain the IP address of the name servers you wish to use, like this:
nameserver 194.168.4.123 nameserver 208.67.222.222 nameserver 158.152.1.43 I have no idea how things like systemD work with resolv.conf. The intent of those who designed Unix networking was to have a simple text file that was easy to parse and contained the information needed. I have always stuck to this and create my own resolv.conf and then made it immutable so nothing can change it, and things just work. |
Hi
I have tried adding 8.8.8.8 and 8.8.4.4 in the resolv.conf but it didnt work either |
Duplicate reply
|
It must be a DNS thing. If you can ping a numeric IP only DNS can be failing.
Setting nameserver 8.8.8.8 in /etc/resolv.conf is sensible. But take into account that this file is overwritten every time a new DHCP address is issued. Very important. Try to issue Code:
dig www.google.com If no DNS server is used, stop the dhcp client (not sure how to do that on Centos) or use a fixed IP. Set resolv.conf to nameserver 8.8.8.8 and try again. jlinkels |
never mind it is a broader spectrum then I thought.
|
I cannot run dig, it is not installed. And since no name resolution i cannot run yum either
Quote:
|
Try
Code:
$ ls -al /etc/resolv.conf Quote:
Code:
& systemctl status systemd-resolved |
OP check your router and ensure that it is configured properly to give out the correct DNS Servers. No need to have systemd-resolved or anything else running if you are not providing DNS Services.
|
resolved resolves DNS for clients also.
|
I replace virtualbox with VMware, and everything works fine now.. so something in the Virtualbox
|
All times are GMT -5. The time now is 08:47 PM. |