---
title: "Linux 域名服务器DNS  gentoo dnsmasq"
author: "iammonster"
date: "2010-09-20T15:47:20Z"
tags: []
categories: ["编程语言"]
slug: "linux-dns-gentoo-dnsmasq"
draft: false
lastmod: "2011-02-23T15:02:03Z"
id: 768263
url: "https://jiajun.iteye.com/blog/768263"
---

DNS缓存

`# emerge dnsmasq`

`# nano  /etc/resolv.conf`

`nameserver` `127.0` `.` `0.1`

`#  nano /etc/resolv.dnsmasq.conf`

`# Generated by net-scripts` `for` `interface` `lo`

`nameserver` `8.8` `.` `8.8`

`nameserver` `8.8` `.` `4.4`

`# nano /etc/dnsmasq.conf`

`resolv-file=/etc/resolv.dnsmasq.conf`

`# rc-update add dnsmasq` `default`

本地DNS设置

`# nano /etc/dnsmasq.conf`

`addn-hosts=/etc/dnsmasq.hosts`

`# nano /etc/dnsmasq.hosts`

`192.168` `.` `0.171` `name0.hadoop.com`

`#/etc/init.d/dnsmasq restart`

`# ping name0.hadoop.com`

`成功`