个人工具
登录
查看“UbuntuHelp:Dnsmasq”的源代码 - Ubuntu中文
UbuntuHelp
讨论
查看源代码
历史
搜索
导航
首页
最近更改
随机页面
页面分类
帮助
编辑
编辑指南
沙盒
新闻动态
字词处理
工具
链入页面
相关更改
特殊页面
页面信息
查看“UbuntuHelp:Dnsmasq”的源代码
来自Ubuntu中文
←
UbuntuHelp:Dnsmasq
跳转至:
导航
,
搜索
因为以下原因,你没有权限编辑本页:
您所请求的操作仅限于该用户组的用户使用:
用户
您可以查看与复制此页面的源代码。
{{From|https://help.ubuntu.com/community/Dnsmasq}} {{Languages|UbuntuHelp:Dnsmasq}} == Introduction == DNSmasq provides two services, either of which can be used independently. * DNS service * DHCP service (including features relating to network boot) A local DNS cache can speed up internet browsing because your browser will not need to go to another server, or across the internet, when it looks up a domain name you've used before, e.g. google.com DHCP allows your computer to allocate network addresses to other computers on your wired or wireless network. A computer needs a network address in order to do things like access the internet. DNSmasq does not do "Internet Connection Sharing" however it does do a lot of the hard work needed in the background. With DNSmasq set up, only two additional commands can set up internet connection sharing (ref?). Note that the package "dnsmasq" interferes with Network Manager which can use "dnsmasq-base" to provide DHCP services when sharing an internet connection. Therefore, if you use network manager (fine in simple set-ups only), then install dnsmasq-base, but not dnsmasq. If you have a more complicated set-up, uninstall network manager, use dnsmasq, or similar software (bind9, dhcpd, etc), and configure things by hand. === Setup for dnsmasq === Like much of the Ubuntu packages, dnsmasq is in universe. Make sure its enabled, then run these commands <pre><nowiki> sudo apt-get install dnsmasq </nowiki></pre> dnsmasq can be configured by editing the file <pre><nowiki> /etc/dnsmasq.conf </nowiki></pre> but for many people, the default (or empty) file will provide a good DNS cache system. === Special Cases === * On a LAN, e.g. business or university. You do not want to provide name service or DHCP for a thousand colleagues, so add the line: <code><nowiki>except-interface=eth0</nowiki></code> if eth0 is your internet/LAN connected interface. * Add DHCP server: <code><nowiki>dhcp-range=192.168.0.20,192.168.0.254,255.255.255.0</nowiki></code> This range must not clash with your LAN IP address. Save and exit the file, restart the daemon and you should be running. <pre><nowiki> sudo invoke-rc.d dnsmasq restart </nowiki></pre> DNSmasq is now listening on some interfaces for DNS lookups and/or DHCP requests. You can verify this by running: <pre><nowiki> netstat -ltp # -l = listen, -t = tcp, -p = show program name </nowiki></pre> You can add the line: <code><nowiki>nameserver 127.0.0.1</nowiki></code> to the top of your /etc/resolv.conf file to use the local DNS cache first. Alternatively, the package '''resolvconf''' sorts all this out automatically. {i} '''Note:''' If you have the resolvconf package installed, you cannot use the "`resolv-file=`" option in your `/etc/dnsmasq.conf` configuration file as this value will be overridden by the `init.d` script when dnsmasq is started up. You should specify your upstream DNS servers using a `dns-nameservers` line (and optionally a dns-search line and other dns- options) for each interface in `/etc/network/interfaces`. The resolvconf scripts will automatically create a special file located at `/var/run/dnsmasq/resolv.conf` with your upstream servers and put `127.0.0.1` in `/etc/resolv.conf` to ensure DNS queries on your local machine use dnsmasq. For more information, see the resolvconf(8) man page. ---- [[category:CategoryNetworking]] [[category:UbuntuHelp]]
该页面使用的模板:
模板:From
(
查看源代码
)
模板:Languages
(
查看源代码
)(受保护)
模板:Languages/Lang
(
查看源代码
)(受保护)
返回至
UbuntuHelp:Dnsmasq
。