Ubuntu dns: Difference between revisions
Jump to navigation
Jump to search
No edit summary |
No edit summary |
||
| Line 21: | Line 21: | ||
echo -e “nameserver 178.22.122.100\nnameserver 185.51.200.2” | sudo tee /etc/resolv.conf | echo -e “nameserver 178.22.122.100\nnameserver 185.51.200.2” | sudo tee /etc/resolv.conf | ||
#آخرین روش استافده شده برای سرور ایمیل این بود | #آخرین روش استافده شده برای سرور ایمیل این بود | ||
sudo nano /etc/systemd/resolved.conf | sudo nano /etc/systemd/resolved.conf | ||
#for loca server | |||
sudo nano /etc/netplan/00-installer-config.yaml | |||
#add dns to list in file | |||
# This is the network config written by 'subiquity' | |||
network: | |||
ethernets: | |||
ens160: | |||
addresses: | |||
- 192.168.10.100/24 | |||
nameservers: | |||
addresses: | |||
- 8.8.8.8 | |||
- 1.1.1.1 | |||
- 185.20.163.2 | |||
- 185.20.163.4 | |||
- 87.107.110.109 | |||
- 87.107.110.110 | |||
search: | |||
- 8.8.8.8 | |||
- 1.1.1.1 | |||
- 185.20.163.2 | |||
- 185.20.163.4 | |||
- 87.107.110.109 | |||
- 87.107.110.110 | |||
routes: | |||
- to: default | |||
via: 192.168.10.1 | |||
version: 2 | |||
run apply | |||
sudo netplan apply | |||
view chenged file | |||
sudo nano /etc/resolv.conf | |||
Revision as of 09:47, 27 April 2026
Edit the Netplan configuration file (usually located in /etc/netplan/). For example: sudo nano /etc/netplan/01-network-manager-all.yaml.
To configure a static IP, modify the network: section with your desired IP address, gateway, and DNS servers.
edit
sudo nano /etc/netplan/01-network-manager-all.yaml
Apply the changes:
sudo netplan apply
can view your DNS On this file
nano /etc/resolv.conf
sudo nano /etc/systemd/resolved.conf
- یا در صورت استفاده از resolvconf:
echo -e “nameserver 178.22.122.100\nnameserver 185.51.200.2” | sudo tee /etc/resolv.conf
- آخرین روش استافده شده برای سرور ایمیل این بود
sudo nano /etc/systemd/resolved.conf
- for loca server
sudo nano /etc/netplan/00-installer-config.yaml
- add dns to list in file
# This is the network config written by 'subiquity'
network:
ethernets:
ens160:
addresses:
- 192.168.10.100/24
nameservers:
addresses:
- 8.8.8.8
- 1.1.1.1
- 185.20.163.2
- 185.20.163.4
- 87.107.110.109
- 87.107.110.110
search:
- 8.8.8.8
- 1.1.1.1
- 185.20.163.2
- 185.20.163.4
- 87.107.110.109
- 87.107.110.110
routes:
- to: default
via: 192.168.10.1
version: 2
run apply
sudo netplan apply
view chenged file
sudo nano /etc/resolv.conf