Verificació
Client #
DNS per clients Ubuntu: #
- Si falta alguna comanda instaleu les dnsutils
- Procés
- /etc/hosts
- DNS resolver (/etc/resolv.conf (domain ->NO FQDN, search només domini local, nameserver (3 max ) )
- Tots 2 /etc/nsswitch.conf
Verificar quins són els resolvers a Ubuntu #
systemd-resolve --status
git config --global user.email
Verificar quins són els resolvers a Ubuntu #
resolvectl status
Configurar IP servidor DNS a ubuntu #
Netplan #
- Has de configurar al netplan l'apartat nameservers:
- search indica el domini dns que buscarà per defecte. En l'exemple següent si busquem www primer intentaria trobar www , sinó el troba llavors www.iescarlesvallbona.cat i en últim cas www.alternatiu.cat
- A addresses (dintre de nameservers) indica les adresses IP dels diferents servidors DNS. Recorda que el propi servidor DNS també hauria de poder resoldre les IP dels noms que administra i , per tant , s'ha de posar ell mateix com a servidor DNS
network:
version: 2
renderer: networkd
ethernets:
enp3s0:
addresses:
- 172.16.9.50/24
routes:
- to: default
via: 172.16.9.1
nameservers:
search: [iescarlesvallbona.cat, alternatiu.cat]
addresses: [ 172.16.9.251, 172.16.9.252]
Si no hi ha dnsresolver #
-Si no hi ha el soft dnsresolver - Mode consola: Editar el fitxer /etc/resolv.conf i afegir una línia
"nameserver <ip-servidor-dns>"
search nomdecerca
- Si tenim més d'un servidor DNS, n'afegim més línies nameserver.
- En entorn gràfic, al Network Manager configurar servidors DNS separant amb comes les adreces IP dels servidors.
dig #
- dig www.google.es
dig www.google.es
; <<>> DiG 9.8.1-P1 <<>> www.google.es
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 29489
;; flags: qr rd ra; QUERY: 1, ANSWER: 2, AUTHORITY: 2, ADDITIONAL: 2
;; QUESTION SECTION:
;www.google.es. IN A
;; ANSWER SECTION:
www.google.es. 54 IN A 173.194.34.247
www.google.es. 54 IN A 173.194.34.248
;; AUTHORITY SECTION:
google.es. 81098 IN NS ns1.google.com.
google.es. 81098 IN NS ns2.google.com.
;; ADDITIONAL SECTION:
ns1.google.com. 166103 IN A 216.239.32.10
ns2.google.com. 337767 IN A 216.239.34.10
;; Query time: 0 msec
;; SERVER: 172.16.0.1#53(172.16.0.1)
;; WHEN: Thu Oct 17 13:44:52 2013
;; MSG SIZE rcvd: 141
short #
- dig www.google.es +short
roger@m16:~$ dig www.google.es +short
216.58.211.35
Correu / MX #
- dig www.yahoo.com MX
roger@m16:~$ dig www.yahoo.com MX
; <<>> DiG 9.11.2-5-Debian <<>> www.yahoo.com MX
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 61499
;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 1, ADDITIONAL: 1
;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 4096
;; QUESTION SECTION:
;www.yahoo.com. IN MX
;; ANSWER SECTION:
www.yahoo.com. 1447 IN CNAME atsv2-fp-shed.wg1.b.yahoo.com.
;; AUTHORITY SECTION:
wg1.b.yahoo.com. 208 IN SOA yf1.yahoo.com. hostmaster.yahoo-inc.com. 1539243973 30 30 86400 300
;; Query time: 34 msec
;; SERVER: 208.67.222.222#53(208.67.222.222)
;; WHEN: Thu Oct 11 09:47:44 CEST 2018
;; MSG SIZE rcvd: 137
- dig www.yahoo.com MX +short
roger@m16:~$ dig www.yahoo.com MX +short
atsv2-fp-shed.wg1.b.yahoo.com.
SOA #
- dig www.yahoo.com SOA
roger@m16:~$ dig www.yahoo.com SOA
; <<>> DiG 9.11.2-5-Debian <<>> www.yahoo.com SOA
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 15398
;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 1
;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 4096
;; QUESTION SECTION:
;www.yahoo.com. IN SOA
;; ANSWER SECTION:
www.yahoo.com. 1046 IN CNAME atsv2-fp-shed.wg1.b.yahoo.com.
;; Query time: 35 msec
;; SERVER: 208.67.222.222#53(208.67.222.222)
;; WHEN: Thu Oct 11 09:52:16 CEST 2018
;; MSG SIZE rcvd: 76
NS #
- dig www.yahoo.com NS
roger@m16:~$ dig www.yahoo.com NS
; <<>> DiG 9.11.2-5-Debian <<>> www.yahoo.com NS
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 58458
;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 1
;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 4096
;; QUESTION SECTION:
;www.yahoo.com. IN NS
;; ANSWER SECTION:
www.yahoo.com. 1048 IN CNAME atsv2-fp-shed.wg1.b.yahoo.com.
;; Query time: 69 msec
;; SERVER: 208.67.222.222#53(208.67.222.222)
;; WHEN: Thu Oct 11 09:54:24 CEST 2018
;; MSG SIZE rcvd: 76
Tots els registres #
- dig yahoo.com ANY +noall +answer
roger@m16:~$ dig yahoo.com ANY +noall +answer
; <<>> DiG 9.11.2-5-Debian <<>> yahoo.com ANY +noall +answer
;; global options: +cmd
yahoo.com. 1027 IN A 98.137.246.7
yahoo.com. 1027 IN A 98.138.219.231
yahoo.com. 1027 IN A 72.30.35.9
yahoo.com. 1027 IN A 98.138.219.232
yahoo.com. 1027 IN A 98.137.246.8
yahoo.com. 1027 IN A 72.30.35.10
yahoo.com. 1133 IN AAAA 2001:4998:44:41d::3
yahoo.com. 1133 IN AAAA 2001:4998:44:41d::4
yahoo.com. 1133 IN AAAA 2001:4998:58:1836::11
yahoo.com. 1133 IN AAAA 2001:4998:c:1023::5
yahoo.com. 1133 IN AAAA 2001:4998:c:1023::4
yahoo.com. 1133 IN AAAA 2001:4998:58:1836::10
yahoo.com. 1025 IN MX 1 mta5.am0.yahoodns.net.
yahoo.com. 1025 IN MX 1 mta7.am0.yahoodns.net.
yahoo.com. 1025 IN MX 1 mta6.am0.yahoodns.net.
yahoo.com. 132706 IN NS ns4.yahoo.com.
yahoo.com. 132706 IN NS ns1.yahoo.com.
yahoo.com. 132706 IN NS ns2.yahoo.com.
yahoo.com. 132706 IN NS ns5.yahoo.com.
yahoo.com. 132706 IN NS ns3.yahoo.com.
yahoo.com. 579 IN SOA ns1.yahoo.com. hostmaster.yahoo-inc.com. 2018101107 3600 300 1814400 600
yahoo.com. 1500 IN TXT "v=spf1 redirect=_spf.mail.yahoo.com"
yahoo.com. 1500 IN TXT "facebook-domain-verification=gysqrcd69g0ej34f4jfn0huivkym1p"
nslookup #
- nslookup www.google.es
roger@m16:~$ nslookup www.google.es
Server: 208.67.222.222
Address: 208.67.222.222#53
Non-authoritative answer:
Name: www.google.es
Address: 216.58.211.35
Name: www.google.es
Address: 2a00:1450:4003:809::2003
NS #
- nslookup -type=ns yahoo.com
roger@m16:~$ nslookup -type=ns yahoo.com
Server: 208.67.222.222
Address: 208.67.222.222#53
Non-authoritative answer:
yahoo.com nameserver = ns5.yahoo.com.
yahoo.com nameserver = ns2.yahoo.com.
yahoo.com nameserver = ns4.yahoo.com.
yahoo.com nameserver = ns3.yahoo.com.
yahoo.com nameserver = ns1.yahoo.com.
SOA #
- nslookup -type=soa yahoo.com
roger@m16:~$ nslookup -type=soa yahoo.com
Server: 208.67.222.222
Address: 208.67.222.222#53
Non-authoritative answer:
yahoo.com
origin = ns1.yahoo.com
mail addr = hostmaster.yahoo-inc.com
serial = 2018101107
refresh = 3600
retry = 300
expire = 1814400
minimum = 600
Tots els registres #
- nslookup -type=any yahoo.com
roger@m16:~$ nslookup -type=any yahoo.com
Server: 208.67.222.222
Address: 208.67.222.222#53
Non-authoritative answer:
Name: yahoo.com
Address: 98.137.246.7
Name: yahoo.com
Address: 98.138.219.231
Name: yahoo.com
Address: 72.30.35.9
Name: yahoo.com
Address: 98.138.219.232
Name: yahoo.com
Address: 98.137.246.8
Name: yahoo.com
Address: 72.30.35.10
Name: yahoo.com
Address: 2001:4998:44:41d::3
Name: yahoo.com
Address: 2001:4998:44:41d::4
Name: yahoo.com
Address: 2001:4998:58:1836::11
Name: yahoo.com
Address: 2001:4998:c:1023::5
Name: yahoo.com
Address: 2001:4998:c:1023::4
Name: yahoo.com
Address: 2001:4998:58:1836::10
yahoo.com mail exchanger = 1 mta5.am0.yahoodns.net.
yahoo.com mail exchanger = 1 mta7.am0.yahoodns.net.
yahoo.com mail exchanger = 1 mta6.am0.yahoodns.net.
yahoo.com nameserver = ns4.yahoo.com.
yahoo.com nameserver = ns1.yahoo.com.
yahoo.com nameserver = ns2.yahoo.com.
yahoo.com nameserver = ns5.yahoo.com.
yahoo.com nameserver = ns3.yahoo.com.
yahoo.com
origin = ns1.yahoo.com
mail addr = hostmaster.yahoo-inc.com
serial = 2018101107
refresh = 3600
retry = 300
expire = 1814400
minimum = 600
yahoo.com text = "v=spf1 redirect=_spf.mail.yahoo.com"
yahoo.com text = "facebook-domain-verification=gysqrcd69g0ej34f4jfn0huivkym1p"
Debug #
- per si hi han problemes
nslookup -debug yahoo.com
host #
- host www.google.es
www.google.es has address 173.194.34.247
www.google.es has address 173.194.34.248
www.google.es has IPv6 address 2a00:1450:4003:804::1018
Resoldre noms de host (mode gràfic): #
Aplicacions->Eines del sistema->Administració->Eines de Xarxa. Pestanya "Cerca". Posar nom de host.
DNS per clients Windows: #
- Configurar servidor DNS: En entorn gràfic, a la configuració de targeta de xarxa. Resoldre noms de host (consola):
"nslookup pc1.acme.com"
"ping pc1.acme.com"