Difference between pages "Install/Network" and "Package:Bind"

From Funtoo
< Install(Difference between pages)
Jump to navigation Jump to search
(add note)
 
m
 
Line 1: Line 1:
<noinclude>
{{Ebuild
{{InstallPart|Network configuration}}
|Summary=BIND - Berkeley Internet Name Domain - Name Server
</noinclude>
|CatPkg=net-dns/bind
=== Configuring your network ===
|Homepage=http://www.isc.org/software/bind
}}


It's important to ensure that you will be able to connect to your local-area network after you reboot into Funtoo Linux. There are three approaches you can use for configuring your network: NetworkManager, dhcpcd, and the [[Funtoo Linux Networking]] scripts. Here's how to choose which one to use based on the type of network you want to set up.
BIND is a DNS server.


==== Wi-Fi ====
=== Installation ===
===== Using NetworkManager =====
{{console|body=###i## emerge net-dns/bind}}
For laptop/mobile systems where you will be using Wi-Fi and connecting to various networks, NetworkManager is strongly recommended. The Funtoo version of NetworkManager is fully functional even from the command-line, so you can use it even without X or without the Network Manager applet. Here are the steps involved in setting up NetworkManager:


<console>
=== Local Caching Only Server ===
(chroot) # ##i##emerge linux-firmware
{{console|body=###i## echo "dns_servers="127.0.0.1" >> /etc/conf.d/net}}
(chroot) # ##i##emerge networkmanager
(chroot) # ##i##rc-update add NetworkManager default
</console>


Above, we installed linux-firmware which contains a complete collection of available firmware for many hardware devices including Wi-Fi adapters, plus NetworkManager to manage our network connection. Then we added NetworkManager to the <code>default</code> runlevel so it will start when Funtoo Linux boots.
{{file|name=/etc/bind/named.conf|lang=|desc=ensure local listening|body=
listen-on-v6 { ::1; };
listen-on { 127.0.0.1; };
}}


After you reboot into Funtoo Linux, you will be able to add a Wi-Fi connection this way:
{{file|name=/etc/bind/named.conf|lang=|desc=remove /* comments */ disabling this block, optionally add your upstream DNS servers|body=
forward first;
forwarders {
// 123.123.123.123; // Your ISP NS
// 124.124.124.124; // Your ISP NS
// 4.2.2.1; // Level3 Public DNS
// 4.2.2.2; // Level3 Public DNS
8.8.8.8; // Google Open DNS
8.8.4.4; // Google Open DNS
};
}}


{{Note|The following command will not work as long as you are in chroot environment. The reason for this is that addwifi will need dbus and rfkill to be set up. So don't forget to reboot!}}
{{file|name=/etc/resolv.conf|lang=|desc=set the local system to listen to BIND|body=
nameserver 127.0.0.1
}}


<console>
{{console|body=###i## rc-update add named default
# ##i##addwifi -S wpa -K 'wifipassword' mywifinetwork
###i## rc
</console>
}}


The <code>addwifi</code> command is used to configure and connect to a WPA/WPA2 Wi-Fi network named <code>mywifinetwork</code> with the password <code>wifipassword</code>. This network configuration entry is stored in <code>/etc/NetworkManager/system-connections</code> so that it will be remembered in the future. You should only need to enter this command once for each Wi-Fi network you connect to.
{{PageNeedsUpdates}}
 
{{EbuildFooter}}
===== Using wpa_supplicant =====
If for some reason you don't want to use a tool such as NetworkManager or <code>wicd</code>, you can use wpa_supplicant for wireless network connections.
 
First, emerge wpa_supplicant:
 
<console>
(chroot) ###i## emerge -a wpa_supplicant
</console>
 
Now, edit the wpa_supplicant configuration file, located at /etc/wpa_supplicant.conf.
The syntax is very easy:
<pre>
network={
ssid="MyWifiName"
psk="lol42-wifi"
}
 
network={
ssid="Other Network"
psk="6d96270004515a0486bb7f76196a72b40c55a47f"
}
</pre>
 
You will need to add both <code>wpa_supplicant</code> and <code>dhcpcd</code> to the default runlevel. <code>wpa_supplicant</code> will connect to your access point, and <code>dhcpcd</code> will acquire an IP address via DHCP:
 
<console>
(chroot) # ##i##rc-update add dhcpcd default
(chroot) # ##i##rc-update add wpa_supplicant default
</console>
 
==== Desktop (Wired Ethernet) ====
 
For a home desktop or workstation with wired Ethernet that will use DHCP, the simplest and most effective option to enable network connectivity is to simply add <code>dhcpcd</code> to the default runlevel:
 
<console>
(chroot) # ##i##rc-update add dhcpcd default
</console>
 
When you reboot, <code>dhcpcd</code> will run in the background and manage all network interfaces and use DHCP to acquire network addresses from a DHCP server.
 
==== Server (Static IP) ====
 
For servers, the [[Funtoo Linux Networking]] scripts are recommended. They are optimized for static configurations and things like virtual ethernet bridging for virtualization setups. See [[Funtoo Linux Networking]] for information on how to use Funtoo Linux's template-based network configuration system.

Revision as of 13:42, February 5, 2015

Bind

   Tip

We welcome improvements to this page. To edit this page, Create a Funtoo account. Then log in and then click here to edit this page. See our editing guidelines to becoming a wiki-editing pro.


BIND is a DNS server.

Installation

root # emerge net-dns/bind

Local Caching Only Server

root # echo "dns_servers="127.0.0.1" >> /etc/conf.d/net
   /etc/bind/named.conf - ensure local listening
listen-on-v6 { ::1; };
	listen-on { 127.0.0.1; };
   /etc/bind/named.conf - remove /* comments */ disabling this block, optionally add your upstream DNS servers
forward first;
	forwarders {
	//	123.123.123.123;	// Your ISP NS
	//	124.124.124.124;	// Your ISP NS
	//	4.2.2.1;		// Level3 Public DNS
	//	4.2.2.2;		// Level3 Public DNS
		8.8.8.8;		// Google Open DNS
		8.8.4.4;		// Google Open DNS
	};
   /etc/resolv.conf - set the local system to listen to BIND
nameserver 127.0.0.1
root # rc-update add named default
root # rc