Maël JANSEN
    • 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 New
    • Engagement control
    • Make a copy
    • 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 Note Insights Versions and GitHub Sync Sharing URL Create Help
Create Create new note Create a note from template
Menu
Options
Engagement control Make a copy 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
    • Any changes
      Be notified of any changes
    • Mention me
      Be notified of mention me
    • Unsubscribe
    # SAE R3.06 Report : network architecture : DNS #### Group : Maël Jansen / Yahn Bervas 1. [IP configiration for the machines](#IP-configuration-for-the-machines) 2. [Local naming configuration](#Local-naming-configuration) 3. [DNS configuration for the client machines](#DNS-configuration-for-the-client-machines) 4. [DNS servers configuration](#DNS-servers-configuration) 4.1. [Primary server configuration](#Primary-server-configuration) 4.2. [Secondary server configuration](#Secondary-server-configuration) 4.3. [Etude of the LAN server](#Etude-of-the-LAN-server) 4.4. [Principal domain configuration](#Principal-domain-configuration) 4.5. [Reversed zone configuration](#Reversed-zone-configuration) 4.6. [Sub domain configuration](#Sub-domain-configuration) ### IP configuration for the machines To give an IP address with DHCP we need to edit the file : /etc/network/interfaces (on all machines) to add : iface eth0 inet dhcp After doing a ifup to start the interfaces your machine will have their address : dns2 => IP:192.168.0.2 client1 => IP:192.168.0.10 client2 => IP:192.168.0.20 dns1 => IP:192.168.0.1 You can test the communication between the machines with the command : ping <IP> And check the routes with the command : route ![](https://i.imgur.com/DLCR3n3.png) ### Local naming configuration To localy associate a name with the IP you can write in the file : /etc/hosts (on dns1) <IP> <name> You can find a screenshot of the file below : ![](https://i.imgur.com/XsVwyO8.png) Now you can communicate between dns1 and the others machine with their name : ping <name> ### DNS configuration for the client machines To configure the client machines you need to add a rule in the file : /etc/dhcp/dhclient.conf For dns1 and dns2 you need to add : supersede domain-name-servers 127.0.0.1 For client1 : supersede domain-name-servers <IP dns1> For client1 : supersede domain-name-servers <IP dns2> You can find an example screenshot for dns1 below : ![](https://i.imgur.com/fS15SSu.png) To relay the DNS request we need to edit the file : /etc/bind/named.conf.options (on dns1 and dns2) forwarders { 172.16.0.3; }: alow-query { any; }; ### DNS servers configuration #### Primary server configuration To configure a new primary DNS zone we need to define it in the file : /etc/bind/named.conf.local zone "netas" { type master; file "/etc/bind/db.netas"; }; To fill our DNS zone we need to copy the file : /etc/bind/dd.empty in the file that will just define : cp /etc/bind/db.empty /etc/bind/db.netas Now we can update the zone file : (/etc/bind/db.netas) @ IN SOA dns1.netas. contact.netas. ( 1 ; 604800 86400 2419200 86400 ) You need to add a new NS input that will be indicate the name of the principal DNS server (in the zone file too) : @ IN NS dns1 You need to add an input A to specify the IP for dns1 : dns1 IN A <IP dns1> You can find an screeshot of the result below : ![](https://i.imgur.com/KQ88xkA.png) Now you can restart dns1 with the command : systemctl restart named __You need to increment the serial number after each modification of the db.netas file__ You can also do : systemctl reload named to reaload the configurations files without restart your dns1 If you want to check the status of your server you can do : systemctl status named The logs are stored in the file : /var/log/syslog You can also see the complete log with : journalctl --unit named To test your configuration you can do a ping between client1 and dns1.netas ping dns1.netas Now you need to add an input A for dns2 just like hte one for dns1 (in the file : /etc/bind/db.netas on dns1) Add to CNAME input to name the "dns-primaire" and "dns-secondaire" alias to the dns1 and dns2 servers (in the file : /etc/bind/db.netas on dns1) dns-primaire IN CNAME dns1 dns-secondaire IN CNAME dns2 You can use the ping command between the client1 machine and "dns1.netas", "dns2.netas", "dns-primaire.netas" and "dns-secondaire.netas" as you can see below Ping between client1 and dns1.netas ![](https://i.imgur.com/oc1laxy.png) Ping between client1 and dns-primaire.netas ![](https://i.imgur.com/Mrk3JPQ.png) #### Secondary server configuration In the configuration zone of dns1 you have to put a new input to identify dns2 as a server : (in the file : /etc/bind/db.netas on dns1) @ IN NS dns2 On dns2 you need to declare the netas zone as secondary of the dns1 server (on the file : /etc/bind/named.conf.local) zone "netas" { type slave; file "/var/lib/bind/db.netas"; masters { <IP du serveur dns1>; }; }; After restarting the dns1 and dns2 servers you can make a ping between client2 and the machines in the netas zone to verify if they can communicate : example : ping dns1.netas On the client machines you have to use the host command to check if the two server are in the nets zone : host dns-primaire <IP de dns1> host dns-primaire <IP de dns2> host dns-secondaire <IP de dns1> host dns-secondaire <IP de dns2> You can find screenshots of the command performed on client1 below : ![](https://i.imgur.com/3I7imFd.png) ![](https://i.imgur.com/Yq4jvJ9.png) #### Etude of the LAN server There is 22 fix bytes on the IP address because we have /22 on the mask. You can scan the LAN server to collect IP address which composed the sub-net with the commmand : map -T5 -sP 10.0.0.0/22 ![](https://i.imgur.com/KTi6lBw.png) Now you have to connect in ssh with each collected IP to set up the connection between all of the machine which composed the LAN server ssh <username>@<IP machine> username : tc password : plop #### Principal domain configuration You have to add a new input A for each web server (s1, s2, s3) in the file : /etc/bind/db.netas @ IN NS s1 @ IN NS s2 @ IN NS s3 s1 IN A 10.0.2.1 s2 IN A 10.0.2.2 s3 IN A 10.0.2.3 You can add an CNAME input for each web server : creative IN CNAME s1 grayscale IN CNAME s2 wonder IN CNAME s3 You can use ping or host commands if you want to test your alias a on the client1 and client2 machines. Now you have to switch on graphic mod on the client1 machine. Open your browser and test the enregistred site : creative.netas grayscale.netas wonder.netas You can find a screeshot of one of the sites below : ![](https://i.imgur.com/TvtkHzK.png) You can try it on client2 too. #### Reversed zone configuration You need to declare the reversed in the file : /etc/bind/named.conf.local (on dns1) : zone "2.0.10.in-addr.arpa" { type master; file "/etc/bind/db.netas-rev"; }; And in the file : /etc/bind/db.netas-rev : @ IN SOA dns1.netas. contact.netas ( 1 604800 86400 2419200 86400 ) @ IN NS dns1.netas. @ IN NS dns2.netas. 1 IN PTR s1.netas. 2 IN PTR s2.netas. 3 IN PTR s3.netas. You can use ping and host commands to check your new configuration. You have to declare dns2 to make it a second server for the reversed netas zone. You can check it with a ping and host too (on client2 this time). #### Sub-domain configuration You need to add a new NS input in the main netas zone : (in the file : /etc/bind/db.netas) perf IN NS dns1 You have to declare this new sub-domain in the file : /etc/bind/named.conf.local : zone "perf.netas" { type master; file "/etc/bind/db.perf.netas"; }; Create the associate file : @ IN SOA dns1.perf.netas; contact.netas. ( 1 604800 86400 2419200 86400 ) @ IN NS dns1 dns1 IN A <IP de dns1> Complete the file to include the A inputs which pointing on p1 and p2. Verify your configuration by using ping and host on client1.

    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