Zen*_*lys 5 networking domain-name-system linux centos hostname
新安装 Centos 后,我无法让yum、wget或curl工作。我得到的是:
$ curl http://www.google.com
curl: (6) Couldn't resolve host 'www.google.com
Run Code Online (Sandbox Code Playgroud)
最令人惊讶的部分是 ping 实际上似乎有效。
ping www.google.com
Run Code Online (Sandbox Code Playgroud)
第一反应,检查 iptables :我根本没有规则。正如我所说,全新安装。
nameserver 127.0.0.1
nameserver 8.8.8.8
nameserver 8.8.4.4
Run Code Online (Sandbox Code Playgroud)
PS:尝试使用 http:// 和不使用。
删除条目nameserver 127.0.0.1,它至少应该开始工作。
接下来修复您的本地解析器
$ dig @8.8.8.8 www.google.com
; <<>> DiG 9.7.3 <<>> @8.8.8.8 www.google.com
; (1 server found)
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 47139
;; flags: qr rd ra; QUERY: 1, ANSWER: 6, AUTHORITY: 0, ADDITIONAL: 0
;; QUESTION SECTION:
;www.google.com. IN A
;; ANSWER SECTION:
www.google.com. 43199 IN CNAME www.l.google.com.
www.l.google.com. 299 IN A 74.125.227.146
www.l.google.com. 299 IN A 74.125.227.145
www.l.google.com. 299 IN A 74.125.227.144
www.l.google.com. 299 IN A 74.125.227.148
www.l.google.com. 299 IN A 74.125.227.147
;; Query time: 73 msec
;; SERVER: 8.8.8.8#53(8.8.8.8)
;; WHEN: Wed Aug 1 04:14:14 2012
;; MSG SIZE rcvd: 132
$
Run Code Online (Sandbox Code Playgroud)
$ dig @8.8.4.4 www.google.com
; <<>> DiG 9.7.3 <<>> @8.8.4.4 www.google.com
; (1 server found)
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 46533
;; flags: qr rd ra; QUERY: 1, ANSWER: 6, AUTHORITY: 0, ADDITIONAL: 0
;; QUESTION SECTION:
;www.google.com. IN A
;; ANSWER SECTION:
www.google.com. 43152 IN CNAME www.l.google.com.
www.l.google.com. 252 IN A 74.125.227.146
www.l.google.com. 252 IN A 74.125.227.145
www.l.google.com. 252 IN A 74.125.227.144
www.l.google.com. 252 IN A 74.125.227.148
www.l.google.com. 252 IN A 74.125.227.147
;; Query time: 32 msec
;; SERVER: 8.8.4.4#53(8.8.4.4)
;; WHEN: Wed Aug 1 04:15:02 2012
;; MSG SIZE rcvd: 132
$
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
25525 次 |
| 最近记录: |