---
title: "Linux[CentOS] 配置DNS 方法"
author: "fantasyeye"
date: "2013-10-29T16:54:42Z"
tags: []
categories: ["操作系统"]
slug: "linux-centos-dns"
draft: false
lastmod: "2013-10-29T16:54:42Z"
id: 1966164
url: "https://fantasyeye.iteye.com/blog/1966164"
---

1、较新的系统修改文件/etc/sysconfig/network-scripts/ifcfg-eth0

eth0：为第一个网卡

在文件最后一行新增

```
DNS1=218.2.135.1
DNS2=8.8.8.8
```

 2、老系统修改文件/etc/resolv.conf

 

CentOS6.4版本使用第一种方法有效。