Dual-NIC virtual machine does not have Internet access problem: Unknown host www.baidu.com

Source: Internet
Author: User

Environment:

Configuration of two network cards, divided into intranet and external network;

Intranet: Host-only mode 192.168.142.140

External network: NAT mode 192.168.116.140

Configuration file:

NIC configuration file:

[email protected] network-scripts]# cat Ifcfg-eth0
Device=eth0
Type=ethernet
Onboot=yes
Nm_controlled=yes
Bootproto=dhcp
[email protected] network-scripts]# cat ifcfg-eth1
Device=eth1
Type=ethernet
Onboot=yes
Nm_controlled=yes
Bootproto=dhcp

DNS configuration file:

[email protected] network-scripts]# cat/etc/resolv.conf
; Generated By/sbin/dhclient-script
Search Localdomain
NameServer 192.168.142.1

Fault Description:

Ping Gateway and Baidu's IP can be ping, but ping Baidu's domain name www.baidu.com, return ping:unknown host www.baidu.com

Fault Analysis: DNS resolution issues

The IP address for Dhcp,dns was 192.168.142.1 occupied, the command line changed a lot of times no use

[[email protected]~]# Ping www.baidu.com
Ping:unknown Host Www.baidu.com
[[email protected]~]# Ping www.baidu.com
Ping:unknown Host Www.baidu.com
[[email protected]~]# Ping 119.75.218.70
PING 119.75.218.70 (119.75.218.70) bytes of data.
Bytes from 119.75.218.70:icmp_seq=1 ttl=128 time=10.6 ms
Bytes from 119.75.218.70:icmp_seq=2 ttl=128 time=5.69 ms
Bytes from 119.75.218.70:icmp_seq=3 ttl=128 time=5.39 ms
Bytes from 119.75.218.70:icmp_seq=4 ttl=128 time=13.2 ms
Bytes from 119.75.218.70:icmp_seq=5 ttl=128 time=7.67 ms
Bytes from 119.75.218.70:icmp_seq=6 ttl=128 time=9.23 ms
Bytes from 119.75.218.70:icmp_seq=7 ttl=128 time=34.4 ms
Bytes from 119.75.218.70:icmp_seq=8 ttl=128 time=12.0 ms
^c
---119.75.218.70 ping statistics---
8 Packets transmitted, 8 received, 0% packet loss, time 7382ms
RTT Min/avg/max/mdev = 5.395/12.299/34.452/8.780 ms


Fault resolution:

Setup starts the configuration of the NIC on the GUI and reconfigure the IP address;

The configuration file after the configuration is successful is as follows:

[[email protected]network-scripts]# Cat Ifcfg-eth0
Device=eth0
Type=ethernet
Onboot=yes
Nm_controlled=yes
Bootproto=none
ipaddr=192.168.116.140
netmask=255.255.255.0
gateway=192.168.116.2
dns1=192.168.116.2
hwaddr=00:0c:29:5c:fe:67
Ipv6init=no
Userctl=no
[[email protected]network-scripts]# Cat Ifcfg-eth1
Device=eth1
Type=ethernet
Onboot=yes
Nm_controlled=yes
Bootproto=none
Ipv6init=no
Userctl=no
hwaddr=00:0c:29:5c:fe:71
ipaddr=192.168.142.140
netmask=255.255.255.0
[[email protected]network-scripts]#

Test:

[[email protected]network-scripts]# Ping www.baidu.com
PING www.baidu.com (119.75.217.109) bytes of data.
Bytes from 119.75.217.109:icmp_seq=1 ttl=128 time=456 ms
Bytes from 119.75.217.109:icmp_seq=2 ttl=128 time=336 ms
Bytes from 119.75.217.109:icmp_seq=3 ttl=128 time=1280 ms
Bytes from 119.75.217.109:icmp_seq=4 ttl=128 time=336 ms
Bytes from 119.75.217.109:icmp_seq=5 ttl=128 time=402 ms
^c
---www.baidu.com ping statistics---
5 Packets transmitted, 5 received, 0% packet loss, time 5380ms
RTT Min/avg/max/mdev = 336.635/562.425/1280.376/361.756 ms, pipe 2

Thank you Li Xiang.

Troubleshooting ideas:

Unknown host www.baidu.com is a DNS problem, ping gateway can pingt,ping Baidu IP can also ping through. Determine the DNS issue;

Modify configuration file Ifcfg-eth0, DNS configuration file, Setup reconfigure NIC

Related principle: DNS principle



Setup Enter, select Network configuration to enter,

650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M01/71/EB/wKioL1Xa45SjeQWDAAEsSjCyUk4420.jpg "style=" float: none; "title=" 1.png "alt=" Wkiol1xa45sjeqwdaaessjcyuk4420.jpg "/>


650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M01/71/EE/wKiom1Xa4X-hOt0tAAB-iZcg64I411.jpg "style=" float: none; "title=" 2.png "alt=" wkiom1xa4x-hot0taab-izcg64i411.jpg "/> DNS configuration Carriage return (modify DNS)



650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M00/71/EB/wKioL1Xa45Sx4mC7AADdfSiarwY459.jpg "style=" float: none; "title=" 3.png "alt=" wkiol1xa45sx4mc7aaddfsiarwy459.jpg "/> DNS modified to 192.168.116.2. OK exit


650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M02/71/EB/wKioL1Xa45WSvWNtAAB_lRGPh88973.jpg "style=" float: none; "title=" 4.png "alt=" wkiol1xa45wsvwntaab_lrgph88973.jpg "/> Device configuration Modify IP Address



650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M02/71/EE/wKiom1Xa4YCixMKEAAF8Ghk6jEk214.jpg "style=" float: none; "title=" 5.png "alt=" Wkiom1xa4ycixmkeaaf8ghk6jek214.jpg "/>


650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M00/71/EE/wKiom1Xa4YGQObVrAAEZJbjmkUY655.jpg "style=" float: none; "title=" 6.png "alt=" wkiom1xa4ygqobvraaezjbjmkuy655.jpg "/>650) this.width=650; src= http://blog.51cto.com /e/u261/themes/default/images/spacer.gif "style=" white-space:normal;border:1px solid rgb (221,221,221); background-position:50% 50%; "alt=" Spacer.gif "/>" * "is canceled by a space, as follows



650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M00/71/EB/wKioL1Xa45aCN8KDAAEWyaV-r2M964.jpg "style=" float: none; "title=" 7.png "alt=" Wkiol1xa45acn8kdaaewyav-r2m964.jpg "/>


650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M00/71/EE/wKiom1Xa4YLhqrw-AAEsgDKgYcE313.jpg "style=" float: none; "title=" 8.png "alt=" Wkiom1xa4ylhqrw-aaesgdkgyce313.jpg "/>


650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M01/71/EB/wKioL1Xa45fA-2CGAAEIhGfD9Eg863.jpg "style=" float: none; "title=" 9.png "alt=" wkiol1xa45fa-2cgaaeihgfd9eg863.jpg "/>650) this.width=650; src= http://blog.51cto.com /e/u261/themes/default/images/spacer.gif "style=" white-space:normal;border:1px solid rgb (221,221,221); background-position:50% 50%; "alt=" Spacer.gif "/> Second network card (intranet) without gateways and DNS



Save exit, restart Network Service

650) this.width=650; "src=" Http://blog.51cto.com/e/u261/themes/default/images/spacer.gif "style=" background-image : URL (""); border:1px solid RGB (221,221,221); background-position:50% 50%; "alt=" Spacer.gif "/>

650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M01/71/EE/wKiom1Xa4YOwZC8jAAIYKEBhoi8011.jpg "style=" float: none; "title=" 10.png "alt=" Wkiom1xa4yowzc8jaaiykebhoi8011.jpg "/>

650) this.width=650; "src="/e/u261/themes/default/images/spacer.gif "style=" Background:url ("/e/u261/lang/zh-cn/ Images/localimage.png ") no-repeat center;border:1px solid #ddd;" alt= "Spacer.gif"/>

650) this.width=650; "src="/e/u261/themes/default/images/spacer.gif "style=" Background:url ("/e/u261/lang/zh-cn/ Images/localimage.png ") no-repeat center;border:1px solid #ddd;" alt= "Spacer.gif"/>

650) this.width=650; "src="/e/u261/themes/default/images/spacer.gif "style=" Background:url ("/e/u261/lang/zh-cn/ Images/localimage.png ") no-repeat center;border:1px solid #ddd;" alt= "Spacer.gif"/>

650) this.width=650; "src="/e/u261/themes/default/images/spacer.gif "style=" Background:url ("/e/u261/lang/zh-cn/ Images/localimage.png ") no-repeat center;border:1px solid #ddd;" alt= "Spacer.gif"/>

650) this.width=650; "src="/e/u261/themes/default/images/spacer.gif "style=" Background:url ("/e/u261/lang/zh-cn/ Images/localimage.png ") no-repeat center;border:1px solid #ddd;" alt= "Spacer.gif"/>

650) this.width=650; "src="/e/u261/themes/default/images/spacer.gif "style=" Background:url ("/e/u261/lang/zh-cn/ Images/localimage.png ") no-repeat center;border:1px solid #ddd;" alt= "Spacer.gif"/>

650) this.width=650; "src="/e/u261/themes/default/images/spacer.gif "style=" Background:url ("/e/u261/lang/zh-cn/ Images/localimage.png ") no-repeat center;border:1px solid #ddd;" alt= "Spacer.gif"/>






Report:

It is recommended that personal feeling is particularly good article

CentOS installation System (very good article) http://wenzhang.baidu.com/article/view?key=83b46b448f7f0d52-1426405486

CentOS CD installation (very good article) http://wenzhang.baidu.com/article/view?key=c32c88e56915e30f-1426405058


This article is from the "Lanzhi" blog, make sure to keep this source http://7826443.blog.51cto.com/7816443/1687712

Dual-NIC virtual machine does not have Internet access problem: Unknown host www.baidu.com

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.