Notice: Function _load_textdomain_just_in_time was called incorrectly. Translation loading for the header-footer-elementor domain was triggered too early. This is usually an indicator for some code in the plugin or theme running too early. Translations should be loaded at the init action or later. Please see Debugging in WordPress for more information. (This message was added in version 6.7.0.) in /var/www/html/abartomeu/wp-includes/functions.php on line 6121
Resolució de noms -

Reloj
00:00:00

Resolució de noms

Resolució de noms per als servidors

Per a instal·lar un DNS en rocky s’han de seguir aquests passos:

  1. Primer hem de configurar el NetworkManager y posar dns=none:

sudo nano/etc/NetworkManager/NetworkManager.conf

  1. Ara s’ha d’editar resolv.conf i posar la la ip 8.8.8.8.

sudo nano /etc/resolv.conf

  1. Finalment s’ha de reiniciar el servei de NetworkManager:

sudo systemctl restart NetworkManager

  1. Ara comença la instal·lació del dns. Ho faré amb el dnmasq. Primer ho hem de instal·lar: sudo dnf install dnsmasq dnsmasq-utils
  1. El segon pas és iniciar i habilitar el dnsmasq:

sudo systemctl start dnsmasq

sudo systemctl enable dnsmasq

  1. Un cop feta la instal·lació, toca fer la configuració:

sudo nano /etc/dnsmasq.conf

# dnsmasq run onUDP port53

# withIP address localhost and 10.0.3.2

# and networkinterfaceeth1

port=53

listen-address=127.0.0.1,10.0.3.2

interface=enp0s8

# disable forwardingof non-routed address

# disable forwarding names without the main domain.com

# automatically append the domain part to simple names

# disable dnsmasq to read/etc/resolv.conf file

domain-needed

bogus-priv

expand-hosts

no-resolv

# upstreamDNS serverfor non-local domains

# using Cloudflare and googlepublicDNS

server=1.1.1.1

server=8.8.8.8

# define the domainfor dnsmasq

domain=joelrouter.com

address=/joelrouter.com/10.0.3.2

# enableDNS Cache and adjust cache-size

cache-size=10000

  1. Ara en el resolv.conf s’ha de posar la ip del vostre ordinador:
  1. Un cop fet això, fem un sudo dnsmasq –test per comprovar si tot està correctament configurat.
  2. Finalment reiniciem el servei: sudo systemctl restart dnsmasq
  3. Ara hem d’instal·lar el sudo dnf install bind-utils.
  1. Ara utilitzarem la comanda dig per comprovar que el domini funciona correctament.
  1. Ara hem de habilitar el firewall:

sudo firewall-cmd –add-service=dns

sudo firewall-cmd –add-source=10.0.3.2/29

sudo firewall-cmd –runtime-to-permanent

sudo firewall-cmd –reload

  1. Verifiquem que el firewall està configurat:

sudo firewall-cmd –list-all

  1. Per comprovar que tot funciona, faré un ping al domini:

I per a que els clients pugin fer ping al enllaç joelrouter.com, s’han de fer aquestes configuracions en el vagrantfile:

  sudo sed -i '/^search smx.lan$/d' /etc/resolv.conf
  sudo sed -i '/^nameserver 10.0.2.3$/d' /etc/resolv.conf
  sudo sed -i '/^nameserver 8.8.8.8$/d' /etc/resolv.conf
  sudo sed -i '/^nameserver 8.8.4.4$/d' /etc/resolv.conf

  # Afegir les noves entrades
  echo "search joelrouter.com" | sudo tee -a /etc/resolv.conf
  echo "nameserver 10.0.3.18" | sudo tee -a /etc/resolv.conf
  echo "nameserver 8.8.8.8" | sudo tee -a /etc/resolv.conf

Leave a Comment