nedeľa 19. februára 2023

nmcli and dns

Redhat use nmcli or nmtui tools for configuration of network. Let me explain how connect dns via nmcli too. 

What is DNS?



DNS very simple: 

- if you find some contact on your mobile phone, you call "mother, boss, wife.." - and the mobile phone know that what the number will be call. 


- DNS is the same. Everyone in this world (except of Saint Godselfs in IT world) doesn't know IP addresses. You know the hostnames or domains (or web pages). If you go to the browser (for example lfc1892.net) - web browser knows the IP address of this web page. Because DNS translate domain name to IP address. 





I think a lot of you knows the command nslookup: 

[root@tuxlovers ~]# nslookup martinus.sk

Server:         10.0.0.2

Address:        10.0.0.2#53


Non-authoritative answer:

Name:   martinus.sk

Address: 185.59.210.26

Name:   martinus.sk

Address: 2a00:1ed0:100::10


Time for nmcli

In linux: 

we know 

/etc/resolv.conf

via nmcli we will configure the command: 

How? 

This: 


nmcli con mod "System eth1" ipv4.dns "10.0.0.2"

nmcli con up "System eth1"

The output: Connection successfully activated (D-Bus active path: /org/freedesktop/NetworkManager/ActiveConnection/3)            


You see: 


[root@linuxlover ~]# cat /etc/resolv.conf

# Generated by NetworkManager

search linuxloves.example

nameserver 10.0.0.2




Žiadne komentáre:

Zverejnenie komentára