이 문서의 내용은 구버전에 해당함.
최신 버전이 아님.
Ubuntu의 경우, network manager 패키지에 설정된 것이 우선권을 가진다고 한다.
/etc/network/interfaces 나 /etc/resolv.conf를 직접 수정해도 적용이 안 된다면,
이 때문일 확률이 높다.
Configuring DHCP address for your network card
If you want to configure DHCP address you need to edit the /etc/network/interfaces and
you need to enter the following lines replace eth0 with your network interface card
sudo vi /etc/network/interfaces
다음과 같이 편집.
# The primary network interface - use DHCP to find our address
auto eth0
iface eth0 inet dhcp
Configuring Static IP address for your network card
If you want to configure Static IP address you need to edit the /etc/network/interfaces and
you need to enter the following lines replace eth0 with your network interface card
sudo vi /etc/network/interfaces
다음과 같이 편집.
# The primary network interface
auto eth0
iface eth0 inet static
address 192.168.3.90
gateway 192.168.3.1
netmask 255.255.255.0
network 192.168.3.0
broadcast 192.168.3.255
# Setting for the domain name system server
dns-nameserver 168.126.63.1 168.126.63.2 8.8.8.8
반드시 설정 변경 이후 netwowrk를 재시작하자.
After entering all the details you need to restart networking services using the following command
sudo /etc/init.d/networking restart
Setting up DNS
Ubuntu에서 DNS 설정 위치는 사용하는 네트워크 관리 방식에 따라 달라진다.
Ubuntu의 경우 가급적 /etc/network/interface 에 DNS server를 설정하는 게 좋다.
구버전 Ubuntu 또는 `ifupdown` 기반 환경에서는 `/etc/network/interfaces`에 `dns-nameservers`, `dns-search` 항목을 설정하고, 이 값이 `resolvconf`를 통해 `/etc/resolv.conf`에 반영되도록 할 수 있다.
https://blueprints.launchpad.net/ubuntu/+spec/foundations-p-dns-resolving
위 링크에서 따르면
Ubuntu에서 /etc/resolv.conf의 관리가 resolvconf로 변경되었고,
resolvconf로 인해 수동편집으로 바꿔봐야 resolvconf가 덮어쓴다.
때문에, resolveconf를 사용해야 한다.
/etc/resolv.conf 수정으로 충분한 경우만 아래를 참고.
When it comes to DNS setup Ubuntu doesn’t differ from other distributions.
You can add hostname and IP addresses to the file /etc/hosts for static lookups.
To cause your machine to consult with a particular server for name lookups you simply add their addresses to /etc/resolv.conf.
For example a machine which should perform lookups from the DNS server at IP address 192.168.3.2 would have a resolv.conf file looking like this
sudo vi /etc/resolv.conf
다음과 같이 편집.
search test.com
nameserver 192.168.3.2
References
https://webdir.tistory.com/188
[Ubuntu] 우분투 네트워크 설정
우분투 12.04.02 버전에서 테스트 되었음 우분투 데스크탑 네트워크 설정 우분투 데스크탑 버전에서는 네트워크 매니저라는 패키지가 그 어떤 네트워크 설정보다 우선순위가 높다. 즉, /etc/resolv.co
webdir.tistory.com
'Computer > Linux' 카테고리의 다른 글
| [Linux] Signal : SIGINT (0) | 2023.04.09 |
|---|---|
| [Linux] vi (or vim) 사용법 정리 (0) | 2023.03.21 |
| [Linux] 화면 캡쳐 단축키 (0) | 2023.01.30 |
| [Linux] Debian 계열 패키지 관리 툴: apt, apt-get (0) | 2023.01.26 |
| [Linux] nano Editor 간단 사용법 (0) | 2023.01.10 |