the host root is unknown host service怎么解决

15226人阅读
linux(7)
&ping: unknown host &&
解决方案:&
&&&如果某台Linux服务器ping不通域名, 如下提示:&
[root@localhost ~]# ping
ping: unknown host
首先确定已经连接上路由器,并且路由器能够访问外网,可以通过访问网关进行确定
[root@localhost ~]# ping 192.168.1.1
PING 192.168.1.1 (192.168.1.1) 56(84) bytes of data.
64 bytes from 192.168.1.1: icmp_seq=1 ttl=64 time=2.96 ms
64 bytes from 192.168.1.1: icmp_seq=2 ttl=64 time=1.75 ms
如果确定网络没问题的情况下, 可以通过如下步骤寻找解决办法:&
1) 确定设置了域名服务器, 没有的话, 建议设置Google的公共DNS服务, 它应该不会出问题的&
[root@localhost ~]# cat /etc/resolv.conf
search localdomain
因为我的DNS没有设置所以导致了ping外网ping不通。将dns添加到该文件中
[root@localhost ~]# vi /etc/resolv.conf
search localdomain
nameserver 202.98.96.68
nameserver 61.139.2.69
2) 确保网关已设置&
# grep GATEWAY /etc/sysconfig/network-scripts/ifcfg*&
-------------------------------------------------------------------&
/etc/sysconfig/network-scripts/ifcfg-eth0:GATEWAY=192.168.40.1&
-------------------------------------------------------------------&
如果未设置, 则通过如下方式增加网关:&
# route add default gw 192.168.40.1&
或者手工编写/etc/sysconfig/network-scripts/ifcfg*文件后, 重启network服务:&
# service network restart&
3) 确保可用dns解析&
# grep hosts /etc/nsswitch.conf&
-------------------------------------------------------------------&
hosts:&&&&& files dns&
-------------------------------------------------------------------&
如果以上哪个有问题, 修正后, 再测试, 应该就没问题了:&
#ping -c 3 &
PING www. (220.181.6.175) 56(84) bytes of data.&
64 bytes from 220.181.6.175: icmp_seq=0 ttl=50 time=9.51 ms&
64 bytes from 220.181.6.175: icmp_seq=1 ttl=50 time=8.45 ms&
64 bytes from 220.181.6.175: icmp_seq=2 ttl=50 time=8.97 ms&
--- www. ping statistics ---&
3 packets transmitted, 3 received, 0% packet loss, time 2002ms&
rtt min/avg/max/mdev = 8.450/8.977/9.511/0.446 ms, pipe 2&
参考知识库
* 以上用户言论只代表其个人观点,不代表CSDN网站的观点或立场
访问:279084次
积分:3702
积分:3702
排名:第7324名
原创:100篇
转载:24篇
评论:17条
(1)(1)(1)(1)(1)(2)(3)(2)(1)(1)(1)(4)(3)(1)(3)(1)(2)(1)(4)(1)(3)(2)(2)(4)(3)(6)(2)(2)(13)(3)(4)(5)(1)(1)(9)(10)(19)General :: Hostname: Unknown Host
Jan 15, 2010
I am installing ISPconfig on a Ubuntu server 9.10. When i write
hostname -f i get the unknown host message.
Similar Messages:
ADVERTISEMENT
Mar 23, 2009
I installed Gnome on my server by when I runCode:[root@F026 ~]# startxCode:hostname: Unknown hostxauth:
creating new authority file /root/.serverauth.2915X.Org X Server 1.5.3Release Date: 5 November 2008X Protocol Version 11, Revision 0Build Operating System: Linux 2.6.18-128.1.1.el5 i686[code]...It have physical access to the system and it is a server located in Europe. Fedora release 10 (Cambridge) is installed in it.
Sep 8, 2009
Many of mails sent from my mail server that are in QThe main reason is deffered by domains like yahoo,aol,etc.but there is one more error that i keep getting and that is Host Unknown,Below is an example from mail log,The catch is,test mail sent on the same email id sent from my personal mail from the same server i.e. url was deliveredHowever,another mail containing client information sent from customercare@mycompanysdomain ended up in queue.There are more examples of the same,around 20 domain have the same problem.Sep
7 14:33:46 server2 sendmail[24591]: n8793jiC024589: to=&abc@xyz.fi&, delay=00:00:00, xdelay=00:00:00, mailer=esmtp, pri=163672, relay=xyz.fi., dsn=5.1.2, stat=Host unknown (Name server: xyz.fi.: host not found)Sep
7 22:09:42 server2 sendmail[6407]: n87Gdffa006403: to=&abc@&, delay=00:00:00, xdelay=00:00:00, mailer=esmtp, pri=152474, relay=., dsn=5.1.2, stat=Host unknown (Name server: .: host not found)
Nov 3, 2009
I have a problem.ADSL modems not see my hostname.My hostname is &unknown&Code:Code:
Nov 25, 2010
I am able to ping my hostname of sinbad only from the linux system itself. On all my windows boxes, I am not able to ping it. I can only ping the IP address.
May 25, 2010
I just built out an Ubuntu Server 10.04.My problem is setting the hostname. I cloned the machine, then normally on the clone, I would change the /etc/hostname and /etc/hosts file.However, when I do this, upon restart, I get the message, &init hostname main process (some process number) terminated with status 1&Then, when the machine finally boots, the hostname is set to (none). Literally has braces like: user@(none):I've tried: sudo hostname machine_name but it says can't resolve hostname (none).I've Google'd around a lot but can't get it. It may have something to do with 10.04? I have been using 9.04, 9.10 with no problems.eric@(none):~$ cat /etc/network/interfaces # This file describes the network interfaces available on your system# and how to activate them. For more information, see interfaces(5).# The loopback network interfaceauto loiface lo inet loopback# The primary network interfacecode....
May 13, 2011
Even ping google's ip address doesn't work. unknown host error using backtrack4 able to browse net with these settings.My network settings:What's the problem with these settings...
Jan 3, 2010
I have a network of 2 WinXP machines and one linux box. I have fiddled around with the settings as you do when learning. The network is working. The network neighbourhood on the WinXP machines recognise the linux box and vice versa, (the linux Places|Network recognises the 2 WinXP). I can Ping the linux box using its hostname from a WinXp. But I cannot do the reverse. I get an 'unknown host' response. I can ping the linux to itself using its hostname.
Mar 24, 2010
I am using comcast ISP with DHCP.When I type in hostname -f it says unknown hostin /etc/sysconfig/networkhostname=in /etc/hosts127.0.0.1
localhost localhost.localdomain192.168.1. in /etc/resolv.confsearch COMCAST SNS SERVERSnameserver 192.168.1.1In linksys router I have host as servix and domain . So why is it returning unknown host?
Jul 25, 2011
When I open Konqueror, on Fedora 15 KDE, it opens to the default Start Page just fine. When I try to visit any other website, it gives me an Unknown Host Error. The documentation I found for KDE just said that if I get that error, it means that either the website does not exist or I am not connected to the internet, but I'm quite sure I'm connected to the internet.
Jan 8, 2010
I can lookup DNS hostnames with dig and nslookup, but nothing else seems to be able to resolve anything. ping, telnet, Firefox, everything gets &unknown host&. For example:& ; &&&& DiG 9.6.1-P2 &&&& ;; global options: +cmd;; Got answer:;; -&&HEADER&&- opcode: QUERY, status: NOERROR, id: 20438;; flags: QUERY: 1, ANSWER: 3, AUTHORITY: 13, ADDITIONAL: 0;; QUESTION SECTION:;.INA;; ANSWER SECTION:.17579INA209.131.36.159.17579INA209.191.93.53.17579INA69.147.114.224;; AUTHORITY SECTION:.10071INNSL.ROOT-SERVERS.NET..10071INNSI.ROOT-SERVERS.NET..10071INNSH.ROOT-SERVERS.NET..10071INNSF.ROOT-SERVERS.NET .....& ping: unknown & ping 209.131.36.159PING 209.131.36.159 (209.131.36.159) 56(84) bytes of data.64 bytes from 209.131.36.159: icmp_seq=1 ttl=55 time=97.2 ms64 bytes from 209.131.36.159: icmp_seq=2 ttl=55 time=98.9 ms
Apr 5, 2010
I am using ubuntu 9.10 and I still cannot figure out this thing. I work behind a proxy managed by my university. Now, I cannot ping the other users on my network although they can ping me. Not to mention, I also cannot ping [URL]... It says : ping: unknown host [URL]... But I can ping the proxy server.
Aug 10, 2010
this issue which has suddenly occurred on both my Desktop and my Laptop. When I try to configure an IP address to any interface I get the following error....uadmin@Ubuntu:~$ ifconfig br0 addr 192.168.10.1/24addr: Unknown hostifconfig: `--help' gives usage information.uadmin@Ubuntu:~$I get this for ethernet interfaces as well. I do not understand what is different as I was able to configure the ip address only the day before yesterday on the laptop..? The Desktop has had this issue for about 3 weeks now.br0
Link encap:Ethernet
HWaddr 32:70:40:91:06:25
inet6 addr: fe80::3070:40ff:fe91:625/64 Scope:LinkUP BROADCAST RUNNING MULTICAST
Metric:1RX packets:0 errors:0 dropped:0 overruns:0 frame:0[Code]....
Dec 4, 2010
I've encountered a problem after doing a fresh install with xubuntu 10.10 (2.6.35-23-generic).some sites are blocked like [url]....if I do dig [url]....- I receive the A, CNAME records and the IP address and everything.when ping[url].... - I receive 'unknown host'.when ping &theipaddress& - I receive responses
Nov 24, 2010
I want to find out my IP and I test this code from beej tutorial:Code:char hostname[128];struct hostent *struct in_addr **addr_struct in_gethostname(hostname, sizeof hostname);printf(&My hostname: %s&, hostname);he = gethostbyname(hostname);if (he == NULL) { // do some error checkingherror(&gethostbyname&); // herror(), NOT perror()return 1;} // print information about this host:printf(&Official name is: %s&, he-&h_name);printf(&IP address: %s&, inet_ntoa(*(struct in_addr*)he-&h_addr));printf(&All addresses: &);addr_list = (struct in_addr **)he-&h_addr_for(i = 0; addr_list[i] != NULL; i++) {printf(&%s &, inet_ntoa(*addr_list[i]));}printf(&&);return 0;But my output is this:Code:My hostname: vBxgethostbyname: Unknown hostI heard that it works in windows, why isn't working in linux?
Jan 22, 2010
I'm having an issue configuring eth0. I'm using ubuntu 8.10 in a virtual machine (VirtualBox). The correct adapter is being used and it has worked in the past. I've tried placing eth0 in dhcp through the GUI and bash, but always get a 169 address or 127.When I run the following command:Code:The output is:Code:
Jan 21, 2010
the difference between $HOSTNAME and $(hostname)?
May 11, 2010
I'm trying to make an SSH script for my place of employment. This script, I want to go out to the server hostnames we have specified (in another file) and change a users account password. We use Kerberized telnet, so if telnet root hostname fails, I want it to use ssh username hostname and use the old password (specified). If both fail, I want it to ask the user what the port should be and input the port in the ssh command.But I'm having a issue having it try telnet root hostname and if it fails then, try to ssh in, I have no clue how to have it proceed. Is it an if statement? Here's the telnet failed message: telnet: Unable to connect to remote host: Connection refused
Jul 9, 2010
Ive got a problem on my server ....installed Debian 5 , Webmin and than syscp settung up syscp ready ....I try to ping &localhost& ansver ping: unknown hostI try to ping &localhost.& there is a host
with IP 127.0.0.1I need it to change it in &localhost& Is that the bind9 maybe?
Jul 29, 2010
I'm having an issue on two Fedora Core 13 machines where I can ping others by hostname, but the hostname resolution fails whenever I use ssh/scp/vnc/etc. I can still do these things by IP address, just not by hostname. RHEL5.3 machines on the same network with the same configuration do not seem to have this problem.Here's the not-so-quick-and-dirty description of the situation:I know that there is a virtual router at 192.168.31.1 and another at 192.168.30.1.
I also know that there is another network (let's call it 90.90.90.0) and on that network lies a number of resources.
By nature of this configuration, any machine on 90.90.90.0 can be accessed by any 192.168.x.x, but not the other way around. Beyond that is out of my hands and currently out of my scope of knowledge.I have a dnsmasq server on 90.90.90.10 that operates as a secondary nameserver, another machine out of my sphere of influence is the primary nameserver (90.90.90.31).The secondary nameserver on 90.90.90.10 holds the hostnames of our development machines. The problem is that in some cases, while I can ping by hostname all day long, services such as ssh, scp, vncviewer, etc all fail to resolve the hostname.
In other cases I can do all of these things.Every machine has an equivalent resolv.conf:As an example, I will show the output of a handful of my development machines:I also included columbia as a one-way test -- even though it cannot access 30.x or 31.x, they can access it:columbia -- physical machine, Red Hat Enterprise 5.3, IP 192.168.100.200Okay, so here are the various outputs. Remember, nibbler, discovery, and atlantis can ALL:- Ping by IP address- Ping by hostname- ssh, scp, vnc, etc by IP addessAdditionally, the SERVFAIL reply from 90.90.90.31 is expected since my dnsmasq server is on the secondary server.Note that the only machine that can both ping and ssh/scp/etc by hostname is nibbler, which also happens to be the only one of the three running RHEL5.3 instead of FC13. Other virtual and physical machines running on the 192.168.31.0 and 192.168.30.0 networks (all running RHEL5.3) work just like nibbler does. So the problem seems to only affect machines running FC13.Final note: selinux is disabled, iptables is disabled, ip6tables is disabled.Other than that, discovery is a brand-spanking-new install straight off of the FC13 DVD. atlantis has been around longer, but its just a file server so I haven't done anything too crazy to it.
Apr 6, 2010
How do I set $HOSTNAME to dynamically update with the hostname that is specified for the ip in DNS?
May 24, 2010
I'm trying to ping another Ubuntu computer on my local network. If I try doing,ping &hostname&then I get the messageping: unknown host &hostname&however, if I doping &hostname&.localthen I get a response back. I was wondering how I can change it so that I can ping without having to append .localI've installed winbind and modified my /etc/nsswitch.conf file but this has made no difference.
May 22, 2011
I have an ubuntu 10.04 server with hostname &&. However, due to migration, we had to change to hostname to something else, &xyz&.I have done changing /etc/hosts and /etc/hostname and run /etc/init.d/hostname start.Checking the hostname and all shows it is now using hostsname of xyz. However, email sending out is still using old hostname. We have some scripts that will send out alerts like failed rsync or hdd space full to my email account. But I see the sender is still &root@&.How do change that to xyz? I am using postfix. I have edited main.cf and restarted postfix but no go.
Oct 20, 2010
I have two servers, one has an empty / and the other has a subdirectory with a large number (4 gig) with many, many files. I need a way to transfer the files en masse from the server with the large number of files to the one that is essentially blank.I don't have space on the used host to simply gzip all the files. I've googled this and see that there may be some combination of tar and/or gzip that will let me do this with some sort of redirection.I really need and example line of how this can be accomplished. If my explanation seems rather sparse, I can supply more details.
Mar 9, 2011
I'm trying to ssh from my laptop to my desktop (both fedora 14) over a local network. I can ping my desktop and get responses, but if I ssh to it, I receivessh: connect to host 192.168.100.xxx port 22: No route to hostI can ssh from the desktop to itself.
Oct 20, 2010
HOW TO GET THE IP ADDRESS OF HOST IN LINUX WITH USING OF HOST AND NSLOOKUP COMMAND and after getting the ip address how to assign it in the variable
Aug 5, 2009
What do host.allow and host.deny do exactly? what are they??
May 5, 2010
I tried posting this before and I'm not sure what happened but I don't think it worked, so if it did please forgive the double post.am very very new to centOS and linux in general.
I just want to setup a test web server that more closely mirrors our actual web server that is hosted by rackspace.
I've installed centOS and tried to setup Apache, PHP and MySQL from a guide on the web using Yum.
When I go to localhost in the web browser I'm able to see the default apache page.
However when I create a php page it's just blank.When I look at the apache error logs I get this: PHP Warning:
Unknown: failed to open stream: Permission denied in Unknown on line 0I've been searching alot on the internet and I know the issue is permission related, but I don't know how to fix it.
I've seen some forum posts that say you need to use the chmod 775 command on the /var/www/html folder.Currently when I do
ls -l /var/www/html it returns-rw------- 1 root root 19 May
5 13:16 index.php-rw------- 1 root root 19 May
5 13:15 index.php~I'm sure that this isn't correct but like I said I don't know much about how to set permissions or who the owner needs to be.
I've done alot of searching and seen similar posts, but no one seems to explain it clearly.
Jul 7, 2010
I'm using Ubuntu 10.04 LTSBy typing the command:hostname --fqdnI get the followinghostname: Name or service not knownAs requested by Rapha?l Hertzog# /etc/nsswitch.conf## Example configuration of GNU Name Service Switch functionality.# If you have the `glibc-doc-reference' and `info' packages installed, try:# `info libc &Name Service Switch&' for information about this file.[Code].....
Apr 12, 2010
I have some problem some one changed hostname on my system. If I do following I seeCode:knoppix:~# cat /etc/hostname debianknoppix which is coming in left side in above output is not my hostname.The hostname is debian.How do I get that name back so that when I do
cat /etc/hostname output is like following.Code:debian:~# cat /etc/hostname debian
Copyrights 2005-15 , All rights reservedSearch similar:
uniqs30729
Unknown Host (server does not have a DNS entry) ?Description: Unable to locate the server named "www.************.com" --- the server does not have a DNS entry. Perhaps there is a misspelling in the server name, or the server no longer exists. Double-check the name and try again. ****what does this mean. Other then the obvious, because this has also come up a few times when i go to sites i've previously been to (they do exist)
& <font color=#2-Mar-14 1:28 am &
It could mean a number of things:1.
They didn't pay their bill.2.
The DNS server that your using didn't update properly.3.
It was a hack site squatting on that DNS Entry.That's about I can think of at the moment.
& <font color=#2-Mar-14 2:44 am &
to This is telling you that your domain-name-server (DNS) cannot find a numerical xxx.xxx.xxx.xxx internet address corresponding to the alpha-numeric host name
that you entered.
It could be that the site doesn't exist, or that you cannot contact your DNS.
Usually you have a backup or secondary DNS to contact too.
Your DNS addresses may be statically or dynamically assigned, depending on your internet service provider (ISP).
& <font color=#2-Mar-14 2:49 am &
Your DNS addresses may be statically or dynamically assigned, depending on your internet service provider (ISP).so can i manually change my DNS address (sorry if i sound stupid, but i don't know how this works)? and if so how.****btw, just an examplefrom &the very first screenshot (in the left) when i click on it, i get********Unknown HostDescription: Unable to locate the server named "www." --- the server does not have a DNS entry.
Perhaps there is a misspelling in the server name, or the server no longer exists.
Double-check the name and try again.
& <font color=#2-Mar-14 3:29 am &
to What type of connection to the internet do you have (cable, DSL, dialup, etc.)?
& <font color=#2-Mar-14 3:40 am &
i got cable (optus in Australia)
& <font color=#2-Mar-14 6:49 am &
to ogadaba....not that you do not have a problem BUT for the example you gave there IS an answer....When I did a Google search for the word taxster....the first selection was.... >>>> Now moved to Taxster.cjb.net. If I then clicked on....Taxster.cjb.net....I was then redirected to &If you have other possible DNS issues....feel free to post other examples. Maybe there is a valid reason for those also.
& <font color=#2-Mar-14 6:52 am &
to Hi... I have the same exact problem... 1% of the sites I try I get this error. If I try over and over I can get through. What's weird is that it only affects one PC... not the others in the house.PacBell DSL - No. Calif, just installed.One of the sites I cannot get to is this one -Another one: &Please help...
& <font color=#2-Mar-21 3:41 am &
to said by ogadaba:Description: Unable to locate the server named "www.************.com" --- the server does not have a DNS entry. Perhaps there is a misspelling in the server name, or the server no longer exists. Double-check the name and try again. what does this mean. Other then the obvious, because this has also come up a few times when i go to sites i've previously been to (they do exist) I've seen this sort of result for valid domains several times in recent days.My first impression is that there is something going on with the root DNS servers.
When locally cached records expire, your ISP's DNS server goes to the root servers for pointers to the authoritative servers, where in turn it retrieves fresh DNS information.In one of the cases where I could not reach a known valid domain, the root servers appeared to be responding that there was no authoritative source, even though a direct check confirmed that the authoritative server existed and was online.I'm seeing some other reports of similar problems.
So far they seem to be short-lived.To be quite honest, I am a bit concerned.
This is the sort of failure that could cause serious Net-wide problems.Any number of innocent things might explain this sort of failure.
Excessive loads, server update gliteches at the root level, etc.
But some not-so innocent possibi attacks on the root servers, expolits of various/possible sorts, perhaps attacks or breakdowns at major backbone nodes.
Whatever it is, I sure hope someone has a handle on it.pchelp
& <font color=#2-Mar-21 1:21 pm &
to I am not having *any* problems accessing sites from my work... the same sites I cannot get to from home... if the problem is outside my PC... it's with the PacBell DNS servers (MHO).
& <font color=#2-Mar-21 2:09 pm &
said by dddonly:I am not having *any* problems accessing sites from my work... the same sites I cannot get to from home... if the problem is outside my PC... it's with the PacBell DNS servers (MHO). Based on what I observed, the problem can't be evaluated quite that way.DNS records have a configurable "time-to-live" parameter that is transmitted with the name/IP information.
If your DNS server's cached record just happens to have expired, it will seek out a fresh one.
Servers whose records are unexpired will hand out the information without having to seek it out again.So while the appearance may be that server A is working while B in fact _whatever_ one of them happens to have an expired record would produce an error if either the root servers or the authoritative source to which they point, should fail to respond or produce flawed data.pchelp
& <font color=#2-Mar-21 2:56 pm &
&Nimda seems to be runing around all over the place again.I think if you look at the Certs...the problem is back.
& <font color=#2-Mar-21 3:43 pm &
to said by ogadaba:btw, just an examplefrom &the very first screenshot (in the left) when i click on it, i get********Unknown HostWhat browser are you using? When i click on those links with IE6 i get the very common "page cannot be displayed" "Cannot find server or DNS ErrorInternet Explorer". Probabaly just bad/broken links.
& <font color=#2-Mar-21 6:53 pm &
to PChelp... thanks, that makes sense... but then why would one of my PCs consistently fail, while the other -- sitting right next to it, talking to the same router/modem -- fail?I've done back to back tests... PC1 never fails... PC2 fails 99% of the time (while accessing a few specific sites).BTW, the machine that fails is Win2000... I ran nslookup and keep getting back "DNS request timed out."
& <font color=#2-Mar-21 6:58 pm &
to &ogadaba, what ever happened back here in this thread? Have you been having this problem since then and is it the same machine?
& <font color=#2-Mar-21 7:38 pm &
to Managed to solve my problem... thanks all.&
& <font color=#2-Mar-22 2:56 am &

我要回帖

更多关于 unknown host怎么解决 的文章

 

随机推荐