wiki:add_dns_server
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revisionLast revisionBoth sides next revision | ||
wiki:add_dns_server [2017/01/12 11:48] – [Method 1] walkeradmin | wiki:add_dns_server [2017/01/12 11:54] – walkeradmin | ||
---|---|---|---|
Line 1: | Line 1: | ||
====== Add DNS Server ====== | ====== Add DNS Server ====== | ||
- | \\ | + | <color orange> |
+ | |||
+ | ---- | ||
+ | |||
Normally we just add the IP Address, Subnet Mask and Gateway to the ifcfg-eth0 file, as that is all we need. But if it is required that we need to update the OS, or add a piece of software (htop for example) then we may need to add the DNS settings. | Normally we just add the IP Address, Subnet Mask and Gateway to the ifcfg-eth0 file, as that is all we need. But if it is required that we need to update the OS, or add a piece of software (htop for example) then we may need to add the DNS settings. | ||
+ | \\ | ||
+ | \\ | ||
+ | While this was written with CentOs 6/7 in mind, it may work for other Linux distributions. | ||
\\ | \\ | ||
\\ | \\ | ||
Line 7: | Line 14: | ||
\\ | \\ | ||
\\ | \\ | ||
+ | |||
+ | ---- | ||
+ | |||
==== Method 1 ==== | ==== Method 1 ==== | ||
\\ | \\ | ||
Line 15: | Line 25: | ||
\\ | \\ | ||
\\ | \\ | ||
- | sudo vi / | + | **//sudo vi / |
\\ | \\ | ||
\\ | \\ | ||
Line 24: | Line 34: | ||
\\ | \\ | ||
\\ | \\ | ||
+ | Then, add static DNS to / | ||
+ | \\ | ||
+ | \\ | ||
+ | **//sudo vi / | ||
+ | \\ | ||
+ | \\ | ||
+ | nameserver 8.8.8.8\\ | ||
+ | nameserver 8.8.4.4\\ | ||
+ | \\ | ||
+ | \\ | ||
+ | |||
+ | ---- | ||
+ | |||
+ | ==== Method 2 ==== | ||
+ | \\ | ||
+ | Alternatively, | ||
+ | \\ | ||
+ | \\ | ||
+ | **//sudo vi / | ||
+ | \\ | ||
+ | \\ | ||
+ | DEVICE=eth0\\ | ||
+ | BOOTPROTO=dhcp\\ | ||
+ | ONBOOT=yes\\ | ||
+ | **DNS1=8.8.8.8**\\ | ||
+ | **DNS2=8.8.4.4**\\ | ||
+ | \\ | ||
+ | \\ | ||
+ | The DNS servers specified with " | ||
wiki/add_dns_server.txt · Last modified: 2023/03/09 22:35 by 127.0.0.1