Ping displays unknown host for any domain name.
It worked before this time true!!
Ping works for ip address but fails for domain names.
Can any one help me?
Check what's in /etc/resolv.conf.
If there is no "nameserver" specified, you have to do that in order to resolve domains.
Example:
nameserver dns1.domainname.com
nameserver dns2.domainname.com
or you can use Google's public DNS servers:
nameserver 8.8.8.8
nameserver 8.8.4.4
(1) edit /etc/resolv.conf, add
nameserver dns1.domainname.com
nameserver dns2.domainname.com
(2) another reason may due to /etc/nsswitch.conf
add dns in the hosts: xxx
Related
Lets's look at following /etc/resolv.conf at client side:
# Generated by NetworkManager
search reddog.microsoft.com
nameserver 10.7.1.53
An 10.7.1.53 address is address of dnsmasq server. Is it possible to configure dnsmasq in such way that client of dnsmasq add some search domain ? I mean:
# Generated by NetworkManager
search reddog.microsoft.com my.domain.com
nameserver 10.7.1.53
I was unable to ping internal hosts.
I created an /etc/resolv.conf file in the form
nameserver internal
nameserver internal
search internal.mycomp.com mycomp.com
This worked perfectly for resolving internal host names.
However, ping www.google.com or ping www.ubuntu.com would now fail.
So, sudo apt-get would also fail.
I added opendns to resolv.conf
nameserver opendns
nameserver internal
nameserver internal
search internal.mycomp.com mycomp.com
Now ping www.ubuntu.com works, but internal resolution fails.
It would be nice to have both internal and external DNS working simultaneously.
How do I exclude DNS from the DHCP lease request on a Raspberry Pi?
I tried updating /etc/resolv.conf but it's reset after a while.
Reason: I am on a home network, and the home router uses itself as the DNS server, but the router's DNS service isn't working properly sometimes.
Most of the answers didn't work for me, but I found that this worked:
sudo vi /etc/dhcpcd.conf
Added a line (note that there is no comma):
static domain_name_servers=8.8.8.8 8.8.4.4
And unplugged and replugged my ethernet cable, which updates the resolver...
cat /etc/resolv.conf
Now shows:
# Generated by resolvconf
domain example.com
nameserver 8.8.8.8
nameserver 8.8.4.4
This also a better way to fix the problem where changes to /etc/resolv.conf are lost on reboot.
I asume the problem is, that the dhcpclient is getting new information about DNS servers with every dhcp-renewal. Add this line into /etc/dhcp/dhclient.conf:
option domain-name-servers 192.168.1.8, 8.8.8.8, 8.8.4.4
Of course you should replace the ip-addresses with the ones from your demanded DNS server. Probably restart the according service.
I am working on RHEL 6.3, the IP address of this server is 172.xxx.xxx.xx and hostname is build01.xxx.com
I have a DNS entries of client server, I have configured that in /etc/sysconfig/network-scripts/ifcfg-eth0 and in /etc/resolv.conf
[root#build01 ~]# cat /etc/resolv.conf
search 100.xxx.x
nameserver 203.xxx.xxx.xxx ##Primary DNS
nameserver 203.xxx.xxx.xxx ###Secondary DNS
[root#build01 etc]# cat /etc/hosts
127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4
172.xxx .xxx.xx build01.xxx.com build01
[root#build01 ~]# hostname
build01.xxxx.com
My issue is when I hit the URL with hostname(buil01.xxx.in) it does not work, but it works with IP (172.xxx.xxx.xx)
This is the error which i get in browser if I type hostname
Host Not Found
**DNS error (the host name of the page you are looking for does not exist) or Server did not accept the connection.
Please check that the host name has been spelled correctly.**
Internet works in this machine only issue is with hostname
Please help me what I am missing to configure
Thanks
Roopa
The search line in resolv.conf should list the local domain. So change:
search 100.xxx.x
to:
search xxx.com
Actually you should also change search to domain. For more information have a look at man resolv.conf.
I have a centOS system(embedded and has very binaries) with the following /etc/hosts.
$cat /etc/hosts
127.0.0.1 localhost localhost
Also the host is assigned a DNS server which returns some invalid IP for the domain name lookup of localhost. But I cannot avoid a connection to this DNS due to some network restrictions.
My question is, when I already have a valid /etc/hosts file why is the system querying the DNS for localhost? And how can I stop that?
Any help would be greatly appreciated.
Check that you have files listed before dns for the hosts entry in /etc/nsswitch.conf.
[me#home]$ grep "^hosts" /etc/nsswitch.conf
hosts: files dns
If dns comes first, then your system will always query DNS to resolve hostnames before falling back to /etc/hosts.