David
    • Create new note
    • Create a note from template
      • Sharing URL Link copied
      • /edit
      • View mode
        • Edit mode
        • View mode
        • Book mode
        • Slide mode
        Edit mode View mode Book mode Slide mode
      • Customize slides
      • Note Permission
      • Read
        • Only me
        • Signed-in users
        • Everyone
        Only me Signed-in users Everyone
      • Write
        • Only me
        • Signed-in users
        • Everyone
        Only me Signed-in users Everyone
      • Engagement control Commenting, Suggest edit, Emoji Reply
    • Invite by email
      Invitee

      This note has no invitees

    • Publish Note

      Share your work with the world Congratulations! 🎉 Your note is out in the world Publish Note

      Your note will be visible on your profile and discoverable by anyone.
      Your note is now live.
      This note is visible on your profile and discoverable online.
      Everyone on the web can find and read all notes of this public team.
      See published notes
      Unpublish note
      Please check the box to agree to the Community Guidelines.
      View profile
    • Commenting
      Permission
      Disabled Forbidden Owners Signed-in users Everyone
    • Enable
    • Permission
      • Forbidden
      • Owners
      • Signed-in users
      • Everyone
    • Suggest edit
      Permission
      Disabled Forbidden Owners Signed-in users Everyone
    • Enable
    • Permission
      • Forbidden
      • Owners
      • Signed-in users
    • Emoji Reply
    • Enable
    • Versions and GitHub Sync
    • Note settings
    • Note Insights
    • Engagement control
    • Transfer ownership
    • Delete this note
    • Save as template
    • Insert from template
    • Import from
      • Dropbox
      • Google Drive
      • Gist
      • Clipboard
    • Export to
      • Dropbox
      • Google Drive
      • Gist
    • Download
      • Markdown
      • HTML
      • Raw HTML
Menu Note settings Versions and GitHub Sync Note Insights Sharing URL Create Help
Create Create new note Create a note from template
Menu
Options
Engagement control Transfer ownership Delete this note
Import from
Dropbox Google Drive Gist Clipboard
Export to
Dropbox Google Drive Gist
Download
Markdown HTML Raw HTML
Back
Sharing URL Link copied
/edit
View mode
  • Edit mode
  • View mode
  • Book mode
  • Slide mode
Edit mode View mode Book mode Slide mode
Customize slides
Note Permission
Read
Only me
  • Only me
  • Signed-in users
  • Everyone
Only me Signed-in users Everyone
Write
Only me
  • Only me
  • Signed-in users
  • Everyone
Only me Signed-in users Everyone
Engagement control Commenting, Suggest edit, Emoji Reply
  • Invite by email
    Invitee

    This note has no invitees

  • Publish Note

    Share your work with the world Congratulations! 🎉 Your note is out in the world Publish Note

    Your note will be visible on your profile and discoverable by anyone.
    Your note is now live.
    This note is visible on your profile and discoverable online.
    Everyone on the web can find and read all notes of this public team.
    See published notes
    Unpublish note
    Please check the box to agree to the Community Guidelines.
    View profile
    Engagement control
    Commenting
    Permission
    Disabled Forbidden Owners Signed-in users Everyone
    Enable
    Permission
    • Forbidden
    • Owners
    • Signed-in users
    • Everyone
    Suggest edit
    Permission
    Disabled Forbidden Owners Signed-in users Everyone
    Enable
    Permission
    • Forbidden
    • Owners
    • Signed-in users
    Emoji Reply
    Enable
    Import from Dropbox Google Drive Gist Clipboard
       owned this note    owned this note      
    Published Linked with GitHub
    2
    Subscribed
    • Any changes
      Be notified of any changes
    • Mention me
      Be notified of mention me
    • Unsubscribe
    Subscribe
    # DNS Server ****En aquest document HackMD explicarem com crear un servidor DNS:**** ## Participants del grup: Josep Oriol Ferrufino: (cf21oriol.ferrufino@iesjoandaustria.org) David Li: (cf21david.li@iesjoandaustria.org) Nazmul Miah: (cf21nazmul.miah@iesjoandaustria.org) Bruno Gosálvez: (cf21bruno.gosalvez@iesjoandaustria.org) # Primera parte del DNS ## Primero: Actualizamos nuestra maquina - **Sudo apt update** - **Sudo apt upgrade** ## Segundo: Instalamos Bind - **sudo apt install bind9 bind9-doc resolvconf python-ply-doc** Entramos dentro del directorio - **cd /etc/bind/** Ponemos comando ls -l para ver los archivos ## Tercero: Configurar el archivo de opciones - **sudo nano /etc/bind/named.conf.options** Dentro del archivo escribimos lo siguiente: - acl "trusted" { 10.21.73.2; #ponemos nuestra ip 10.21.73.100; #ponemos la ip del host }; options{ directory "/var/cache/bind"; recursion yes; # allow-recursion { trusted; }; listen-on {10.21.73.2; }; allow-transfer { none; }; forwaders { 8.8.8.8; 1.1.1.1; }; dnssec-validation auto; listen-on-v6 { any; }; }; Lo guardamos y salimos ## Quarto: Configuramos el archivo local En este paso entramos dentro del archivo local poniendo este comando. **- sudo nano /etc/bind/named.conf.local** Y dentro editamos de esta manera zone "dli.test" { #ponemos nuestro dominio que pondremos de esta forma -primera letra de nuestro nombre + el primero apellido + .test type master; file "/etc/bind/db.dli.test"; #aqui ponemos nuestro dominio con la nomenclatura que hemso puesto antes. }; zone "21.10.in-addr.arpa" { type master; file "/etc/bind/zones/db.10.21"; } Ahora lo guardamos y salimos. ## Quinta: Crear el archivo de la zona de reenvío Acontinuacion ponemos este comando para crear el directorio donde dejaremos nuestros archivos de zona. **- sudo mkdir /etc/bind/zones** Luego seguimos con este comando para copiar a la ubicacion adecuada. **- sudo cp /etc/bind/db.local /etc/bind/db.dli.test** Una vez hecha el cambio de archivo de ubicacion entramos dentro del archivo con el siguiente comando. **- sudo nano /etc/bind/zones/db.dli.test Dentro del archivo cambiamos algunas cosas. ; ; BIND data file for local loopback interface ; $TTL 604800 @ IN SOA server.dli.test. admin.dli.test. ( 3 ; Serial 604800 ; Refresh 86400 ; Retry 2419200 ; Expire 604800 ) ; Negative Cache TTL ; ; name servers - NS records IN NS server.dli.test ; name servers - A records server.dli.test. IN A 10.21.73.2 ;10.21.73.0/24 - A records client.dli.test. IN A 10.21.73.100 Despues de editar este archivo ahora editaremos los archivos de la zona inversa ## Sexto: Crear los archivos de la zona inversa En la zona inversa que hemos creado dentro con el archivo named.conf.local, con nuestros archivos inversa que utilizaremos el db.127 de muestra que lo copiaremos en la ubicacion del zones. Utilizamos este comando para copiar la ubicacion. **- sudo cp /etc/bind/db.127 /etc/bind/zones/db.10.21** Despues de copiar la ubicacion a otro sitio, lo editamos con este comando. **- sudo nano /etc/bind/zones/db.10.21** - ; ; BIND reverse data file for local loopback interface ; $TTL 604800 @ IN SOA server.dli.test. admin.dli.test. ( 3 ; Serial 604800 ; Refresh 86400 ; Retry 2419200 ; Expire 604800 ) ; Negative Cache TTL ; @ IN NS localhost. 1.0.0 IN PTR localhost. ; name server IN NS server.dli.test. ; PTR Records 2.71 IN PTR server.dli.test. ;10.21.73.2 00.71 IN PTR client.dli.test. ;10.21.73.100 Acontinuacion tenemos que hacer una prueba para ver si lo tenemos el sintaxi haciendo de los archivos con este comando. **- sudo named-checkconf** Si te sale algun error lo corregimos, si no sale ninguno seguimos adelante. Para saber si los archivos de zona estan correctos lo comprobamos con este comando. Ahora despues de poner este comando vamos con los siguientes comandos para acabar de configurar servidor el DNS primario. El comando sirve para reiniciar el bind **- sudo systemctl restart bind9** Luego escribimos lo siguiente que sirve para que el DNS primario que quedara bien configurado y listo para responder a las consultas de DNS. **- sudo ufw allow Bind9 # Segunda parte del DNS, configuraremos los clientes DNS ## Septimo: Ponemos este comando para ver la interfaz que quremos: **- ip address show to 10.21.0.0/24** Seguimos con el siguiente comando para crear un archivo en /etc/netplan que se llamarà 00-private-nameservers.yaml: **- sudo nano /etc/netplan/00-private-nameservers.yaml** En el archivo previamente creado escribimos esto: network: version: 2 ethernets: eth1: #Private network interface nameservers: addresses: - 10.128.10.11 # Private IP for ns1 - 10.132.20.12 # Private IP for ns2 search: [ nyc3.example.com ] # DNS zone Despues escribimos: **- sudo netplan try** Nos saldra tres linias, con un comunicado, le damos intro y nos dirá configuracion acceptada. Output Warning: Stopping systemd-networkd.service, but it can still be activated by: systemd-networkd.socket Do you want to keep these settings? Press ENTER before the timeout to accept the new configuration Changes will revert in 120 seconds Luego verificamos la resolucion de DNS del sistema para ver si se ha aplicado nuestro configuracion de DNS con el siguiente comando: **- sudo systemd-resolved --status** Nos salda esto: Output . . . Link 3 (eth1) Current Scopes: DNS LLMNR setting: yes MulticastDNS setting: no DNSSEC setting: no DNSSEC supported: no DNS Servers: ipserver DNS Domain: tu.dominio.com Ya habremos configurado los servidores internos. Para probar clientes tendremos que utiliza **nslookup** $ nslookup nom.exemple.test Nos saldra algo similar a esto: Output Server: 127.0.0.53 Address: 127.0.0.53#53 Non-authoritative answer: Name: cliente.exemple.test Address: ipcliente Ahora probaremos con una busqueda inversa: $ nslookup ip El resultado sera algo similar a: Output ipserver.in-addr.arpa name = nom.example.test. Authoritative answers can be found from: Como se puede observar la IP del servidor está invertida. # Conclusión: Configurar el DNS nos permite poder referirnos a las distintas interfaces de nuestra red privada por el nombre en vez de por la dirección IP. # Webgrafia DNS * [Digital Ocean](https://www.digitalocean.com/community/tutorials/how-to-configure-bind-as-a-private-network-dns-server-on-ubuntu-18-04-es#configurar-el-servidor-dns-primari) * [RedesZone](https://www.redeszone.net/tutoriales/servidores/configurar-servidor-dns-bind-linux/) * [zytrax.open](https://www.zytrax.com/books/dns/ch8/) DHCP * [Enllaç](https://www.linuxfordevices.com/tutorials/ubuntu/dhcp-server-on-ubuntu)

    Import from clipboard

    Paste your markdown or webpage here...

    Advanced permission required

    Your current role can only read. Ask the system administrator to acquire write and comment permission.

    This team is disabled

    Sorry, this team is disabled. You can't edit this note.

    This note is locked

    Sorry, only owner can edit this note.

    Reach the limit

    Sorry, you've reached the max length this note can be.
    Please reduce the content or divide it to more notes, thank you!

    Import from Gist

    Import from Snippet

    or

    Export to Snippet

    Are you sure?

    Do you really want to delete this note?
    All users will lose their connection.

    Create a note from template

    Create a note from template

    Oops...
    This template has been removed or transferred.
    Upgrade
    All
    • All
    • Team
    No template.

    Create a template

    Upgrade

    Delete template

    Do you really want to delete this template?
    Turn this template into a regular note and keep its content, versions, and comments.

    This page need refresh

    You have an incompatible client version.
    Refresh to update.
    New version available!
    See releases notes here
    Refresh to enjoy new features.
    Your user state has changed.
    Refresh to load new user state.

    Sign in

    Forgot password

    or

    By clicking below, you agree to our terms of service.

    Sign in via Facebook Sign in via Twitter Sign in via GitHub Sign in via Dropbox Sign in with Wallet
    Wallet ( )
    Connect another wallet

    New to HackMD? Sign up

    Help

    • English
    • 中文
    • Français
    • Deutsch
    • 日本語
    • Español
    • Català
    • Ελληνικά
    • Português
    • italiano
    • Türkçe
    • Русский
    • Nederlands
    • hrvatski jezik
    • język polski
    • Українська
    • हिन्दी
    • svenska
    • Esperanto
    • dansk

    Documents

    Help & Tutorial

    How to use Book mode

    Slide Example

    API Docs

    Edit in VSCode

    Install browser extension

    Contacts

    Feedback

    Discord

    Send us email

    Resources

    Releases

    Pricing

    Blog

    Policy

    Terms

    Privacy

    Cheatsheet

    Syntax Example Reference
    # Header Header 基本排版
    - Unordered List
    • Unordered List
    1. Ordered List
    1. Ordered List
    - [ ] Todo List
    • Todo List
    > Blockquote
    Blockquote
    **Bold font** Bold font
    *Italics font* Italics font
    ~~Strikethrough~~ Strikethrough
    19^th^ 19th
    H~2~O H2O
    ++Inserted text++ Inserted text
    ==Marked text== Marked text
    [link text](https:// "title") Link
    ![image alt](https:// "title") Image
    `Code` Code 在筆記中貼入程式碼
    ```javascript
    var i = 0;
    ```
    var i = 0;
    :smile: :smile: Emoji list
    {%youtube youtube_id %} Externals
    $L^aT_eX$ LaTeX
    :::info
    This is a alert area.
    :::

    This is a alert area.

    Versions and GitHub Sync
    Get Full History Access

    • Edit version name
    • Delete

    revision author avatar     named on  

    More Less

    Note content is identical to the latest version.
    Compare
      Choose a version
      No search result
      Version not found
    Sign in to link this note to GitHub
    Learn more
    This note is not linked with GitHub
     

    Feedback

    Submission failed, please try again

    Thanks for your support.

    On a scale of 0-10, how likely is it that you would recommend HackMD to your friends, family or business associates?

    Please give us some advice and help us improve HackMD.

     

    Thanks for your feedback

    Remove version name

    Do you want to remove this version name and description?

    Transfer ownership

    Transfer to
      Warning: is a public team. If you transfer note to this team, everyone on the web can find and read this note.

        Link with GitHub

        Please authorize HackMD on GitHub
        • Please sign in to GitHub and install the HackMD app on your GitHub repo.
        • HackMD links with GitHub through a GitHub App. You can choose which repo to install our App.
        Learn more  Sign in to GitHub

        Push the note to GitHub Push to GitHub Pull a file from GitHub

          Authorize again
         

        Choose which file to push to

        Select repo
        Refresh Authorize more repos
        Select branch
        Select file
        Select branch
        Choose version(s) to push
        • Save a new version and push
        • Choose from existing versions
        Include title and tags
        Available push count

        Pull from GitHub

         
        File from GitHub
        File from HackMD

        GitHub Link Settings

        File linked

        Linked by
        File path
        Last synced branch
        Available push count

        Danger Zone

        Unlink
        You will no longer receive notification when GitHub file changes after unlink.

        Syncing

        Push failed

        Push successfully