Cloudron makes it easy to run web apps like WordPress, Nextcloud, GitLab on your server. Find out more or install now.


Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Bookmarks
  • Search
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Brand Logo

Cloudron Forum

Apps | Demo | Docs | Install
  1. Cloudron Forum
  2. Support
  3. how to change DNS settings of my server ?

how to change DNS settings of my server ?

Scheduled Pinned Locked Moved Solved Support
dns
21 Posts 5 Posters 2.2k Views 5 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • C Offline
    C Offline
    cylon
    wrote on last edited by girish
    #1

    The current DNS is blocking a torrent tracker URL.
    I need to change the DNS to Quad9:

    IP v4: 9.9.9.9 / 9.9.9.10
    IP v6: 2620:fe::9 / 2620:fe::10
    

    How can change the DNS for the whole server ? Or for Transmission app ?

    1 Reply Last reply
    0
    • murgeroM Offline
      murgeroM Offline
      murgero
      App Dev
      wrote on last edited by
      #2

      On the server hosting your apps, you may need to change the config here: /etc/resolv/conf

      --
      https://urgero.org
      ~ Professional Nerd. Freelance Programmer. ~

      1 Reply Last reply
      0
      • C Offline
        C Offline
        cylon
        wrote on last edited by
        #3

        is it something I can do from cloudron or must I ssh into the server ?

        1 Reply Last reply
        0
        • C Offline
          C Offline
          cylon
          wrote on last edited by
          #4

          I tried to shh and edit the /etc/resolv/conf file but the file does not exists and if I try to create one with sudo vim /etc/resolv/conf I have a error: E212: Can't open file for writing

          When I ssh I see this, so I wonder if it is somehow cloudron also managing the resolv/conf file ?

          The list of available updates is more than a week old.                              
          To check for new updates run: sudo apt update                                       
          **********************************************************************              
                                                                                              
                                  NOTE TO CLOUDRON ADMINS                                     
                                  -----------------------                                     
          Please do not run apt upgrade manually as it will update packages that              
          Cloudron relies on and may break your installation. Ubuntu security updates         
          are automatically installed on this server every night.                             
                                                                                              
          Read more at https://docs.cloudron.io/security/#os-updates                          
                                                                                              
          For help and more information, visit https://forum.cloudron.io                      
                                                                                              
          **********************************************************************  
          
          
          1 Reply Last reply
          0
          • murgeroM Offline
            murgeroM Offline
            murgero
            App Dev
            wrote on last edited by
            #5

            I guess it depends on how your server is setup, docs suggest something different than what I did though so try this too: https://docs.cloudron.io/networking/#dns

            --
            https://urgero.org
            ~ Professional Nerd. Freelance Programmer. ~

            1 Reply Last reply
            0
            • C Offline
              C Offline
              cylon
              wrote on last edited by
              #6

              This doc seems to be for internal name resolution of my servers apps, like (app1.my-cloudron.com)
              What I want is changing the DNS for external name resolution. For instance, instead of using google DNS 8.8.8.8 I want to use 9.9.9.9

              murgeroM 1 Reply Last reply
              0
              • C cylon

                This doc seems to be for internal name resolution of my servers apps, like (app1.my-cloudron.com)
                What I want is changing the DNS for external name resolution. For instance, instead of using google DNS 8.8.8.8 I want to use 9.9.9.9

                murgeroM Offline
                murgeroM Offline
                murgero
                App Dev
                wrote on last edited by
                #7

                @cylon the doc I sent tells you how to setup an upstream dns server which should resolve your issue.

                --
                https://urgero.org
                ~ Professional Nerd. Freelance Programmer. ~

                1 Reply Last reply
                0
                • J Offline
                  J Offline
                  joseph
                  Staff
                  wrote on last edited by
                  #8

                  @cylon I guess you are using netcup ? netcup makes /etc/resolv.conf as readonly using chattr

                  1 Reply Last reply
                  0
                  • C Offline
                    C Offline
                    cylon
                    wrote on last edited by cylon
                    #9

                    no I'm using time4vps.

                    I tried edit the file /etc/systemd/resolve.conf with this:

                    [Resolve] 
                    DNS=9.9.9.9 9.9.9.10
                    

                    but it doesn't seem to work.

                    Is there something else I should do? I don't really understand the unbound DNS configuration in this doc: https://docs.cloudron.io/networking/#dns

                    murgeroM 1 Reply Last reply
                    0
                    • C cylon

                      no I'm using time4vps.

                      I tried edit the file /etc/systemd/resolve.conf with this:

                      [Resolve] 
                      DNS=9.9.9.9 9.9.9.10
                      

                      but it doesn't seem to work.

                      Is there something else I should do? I don't really understand the unbound DNS configuration in this doc: https://docs.cloudron.io/networking/#dns

                      murgeroM Offline
                      murgeroM Offline
                      murgero
                      App Dev
                      wrote on last edited by
                      #10

                      @cylon You might need to restart the systemd service that handles your DNS if it's not the one documented by cloudron

                      --
                      https://urgero.org
                      ~ Professional Nerd. Freelance Programmer. ~

                      1 Reply Last reply
                      0
                      • C Offline
                        C Offline
                        cylon
                        wrote on last edited by cylon
                        #11

                        I did restart systemd-resolved service but doesn't seem to work.
                        After doing so the content of /etc/resolv.conf is :

                        # Dynamic resolv.conf(5) file for glibc resolver(3) generated by resolvconf(8)      
                        #     DO NOT EDIT THIS FILE BY HAND -- YOUR CHANGES WILL BE OVERWRITTEN             
                        # 127.0.0.53 is the systemd-resolved stub resolver.                                 
                                                                                                            
                        nameserver 212.24.109.143                                                           
                        nameserver 80.208.225.143 
                        

                        Shouldn't it be 9.9.9.9 as specified in the /etc/systemd/resolve.conf file ?

                        #  This file is part of systemd.                                                    
                        #                                                                                   
                        #  systemd is free software; you can redistribute it and/or modify it under the     
                        #  terms of the GNU Lesser General Public License as published by the Free          
                        #  Software Foundation; either version 2.1 of the License, or (at your option)      
                        #  any later version.                                                               
                        #                                                                                   
                        # Entries in this file show the compile time defaults. Local configuration          
                        # should be created by either modifying this file, or by creating "drop-ins" in     
                        # the resolved.conf.d/ subdirectory. The latter is generally recommended.           
                        # Defaults can be restored by simply deleting this file and all drop-ins.           
                        #                                                                                   
                        # Use 'systemd-analyze cat-config systemd/resolved.conf' to display the full config.
                        #                                                                                   
                        # See resolved.conf(5) for details.                                                 
                                                                                                            
                        [Resolve]                                                                                                                           
                        DNS=9.9.9.9 9.9.9.10                                                                
                        

                        Cloudron doc says All apps and services use systemd-resolved for name resolution. You can configure systemctl-resolved as required by your network
                        So the above should have work isn't it ?

                        1 Reply Last reply
                        0
                        • J Offline
                          J Offline
                          joseph
                          Staff
                          wrote on last edited by
                          #12

                          @cylon systemd-resolved run on 127.0.0.53 . So, you have to also change /etc/resolv.conf to be nameserver 127.0.0.53 .

                          1 Reply Last reply
                          0
                          • C Offline
                            C Offline
                            cylon
                            wrote on last edited by
                            #13

                            How do I do that ? If I change the file /etc/resolv.conf to add the line

                            nameserver 127.0.0.53
                            

                            It get overwritten at reboot and the line is deleted

                            1 Reply Last reply
                            0
                            • C Offline
                              C Offline
                              cylon
                              wrote on last edited by cylon
                              #14

                              I tried to changed the /etc/unbound/unbound.conf.d/cloudron-network.conf adding this:

                              # Forward all DNS queries to Quad9 DNS                                              
                              forward-zone:                                                                       
                                      name: "."                                                                   
                                      forward-addr: 9.9.9.9                                                       
                                      forward-addr: 149.112.112.112 
                              

                              but request are still going to 212.24.109.143 and not 9.9.9.9

                              what service is managing the /etc/resolve.conf file ?

                              here are all my files:
                              /etc/systemd/resolved.conf:

                              #  This file is part of systemd.                                                    
                              #                                                                                   
                              #  systemd is free software; you can redistribute it and/or modify it under the     
                              #  terms of the GNU Lesser General Public License as published by the Free          
                              #  Software Foundation; either version 2.1 of the License, or (at your option)      
                              #  any later version.                                                               
                              #                                                                                   
                              # Entries in this file show the compile time defaults. Local configuration          
                              # should be created by either modifying this file, or by creating "drop-ins" in     
                              # the resolved.conf.d/ subdirectory. The latter is generally recommended.           
                              # Defaults can be restored by simply deleting this file and all drop-ins.           
                              #                                                                                   
                              # Use 'systemd-analyze cat-config systemd/resolved.conf' to display the full config.
                              #                                                                                   
                              # See resolved.conf(5) for details.                                                 
                                                                                                                  
                              [Resolve]                                                                                       
                              DNS=9.9.9.9 9.9.9.10
                              

                              /etc/resolv.conf:

                              # Dynamic resolv.conf(5) file for glibc resolver(3) generated by resolvconf(8)      
                              #     DO NOT EDIT THIS FILE BY HAND -- YOUR CHANGES WILL BE OVERWRITTEN             
                              # 127.0.0.53 is the systemd-resolved stub resolver.                                 
                                                                                                                  
                              nameserver 212.24.109.143                                                           
                              nameserver 80.208.225.143
                              

                              /run/systemd/resolve/resolv.conf:

                              # This is /run/systemd/resolve/resolv.conf managed by man:systemd-resolved(8).      
                              # Do not edit.                                                                      
                              #                                                                                   
                              # This file might be symlinked as /etc/resolv.conf. If you're looking at            
                              # /etc/resolv.conf and seeing this text, you have followed the symlink.             
                              #                                                                                   
                              # This is a dynamic resolv.conf file for connecting local clients directly to       
                              # all known uplink DNS servers. This file lists all configured search domains.      
                              #                                                                                   
                              # Third party programs should typically not access this file directly, but only     
                              # through the symlink at /etc/resolv.conf. To manage man:resolv.conf(5) in a        
                              # different way, replace this symlink by a static file or a different symlink.      
                              #                                                                                   
                              # See man:systemd-resolved.service(8) for details about the supported modes of      
                              # operation for /etc/resolv.conf.                                                   
                                                                                                                  
                              nameserver 9.9.9.9                                                                  
                              nameserver 9.9.9.10                                                                 
                              search . 
                              

                              Running resolvectl status yield:

                              Global                                                                              
                                     Protocols: -LLMNR -mDNS -DNSOverTLS DNSSEC=no/unsupported                    
                              resolv.conf mode: foreign                                                           
                                   DNS Servers: 9.9.9.9 9.9.9.10                                                  
                                                                                                                  
                              Link 2 (ens3)                                                                       
                              Current Scopes: none                                                                
                                   Protocols: -DefaultRoute +LLMNR -mDNS -DNSOverTLS DNSSEC=no/unsupported        
                                                                                                                  
                              Link 3 (docker0)                                                                    
                              Current Scopes: none                                                                
                                   Protocols: -DefaultRoute +LLMNR -mDNS -DNSOverTLS DNSSEC=no/unsupported        
                                                                                                                  
                              Link 4 (br-e8030366a286)                                                            
                              Current Scopes: none                                                                
                                   Protocols: -DefaultRoute +LLMNR -mDNS -DNSOverTLS DNSSEC=no/unsupported        
                                                                                                                  
                              Link 6 (veth13a1cdd)                                                                
                              Current Scopes: none                                                                
                                   Protocols: -DefaultRoute +LLMNR -mDNS -DNSOverTLS DNSSEC=no/unsupported        
                                                                                                                  
                              Link 8 (vethf77db43)                                                                
                              Current Scopes: none                                                                
                                   Protocols: -DefaultRoute +LLMNR -mDNS -DNSOverT
                              

                              showing that resolv.conf is in mode: foreign

                              what service manage resolv.conf in cloudron ?

                              1 Reply Last reply
                              0
                              • girishG girish marked this topic as a question on
                              • girishG Offline
                                girishG Offline
                                girish
                                Staff
                                wrote on last edited by
                                #15

                                @cylon there's much to unwrap. Unfortunately, the way all these things interact is quite complicated.

                                Before I say anything, are you on Cloudron 8? I am wonder why you have your /etc/resolv.conf handled by resolvconf ? Cloudron 8 has removed this package. If you are still on some < v8, I recommend upgrading first because the instructions to change the DNS are different.

                                For Cloudron 8, here is a checklist:

                                • Make sure resolvconf package is not there . We don't install this anymore intentionally. apt remove resolvconf
                                • /etc/resolv.conf must be a symlink to ../run/systemd/resolve/stub-resolv.conf
                                • systemctl status systemd-resolved must be enabled
                                • Finally, /etc/systemd/resolved.conf has your preferred DNS servers (quad9 in your case).

                                That should be it. After that, host www.cloudron.io should work out of the box.

                                1 Reply Last reply
                                0
                                • scookeS Offline
                                  scookeS Offline
                                  scooke
                                  wrote on last edited by
                                  #16

                                  I used to use Time4VPS and thoroughly enjoyed it. Did you check these out?:
                                  https://www.time4vps.com/knowledgebase/working-with-dns-manager/
                                  https://www.time4vps.com/knowledgebase/create-nameserver-with-your-domain/

                                  A life lived in fear is a life half-lived

                                  1 Reply Last reply
                                  0
                                  • C Offline
                                    C Offline
                                    cylon
                                    wrote on last edited by
                                    #17

                                    I'm still indeed on v7, but I can't update to v8 😞
                                    https://forum.cloudron.io/post/93010

                                    1 Reply Last reply
                                    0
                                    • girishG Offline
                                      girishG Offline
                                      girish
                                      Staff
                                      wrote on last edited by
                                      #18

                                      @cylon for v7, cloudron uses unbound. For Cloudron 7, please check this:

                                      • /etc/resolv.conf should have nameserver 127.0.0.1
                                      • systemctl status unbound should say running
                                      • host www.cloudron.io 127.0.0.1 should work

                                      systemd-resolved is not used at all. So, you can ignore all those related threads and configs. I would like to understand how it got to this state though? Do you think it tried to upgrade to v8 and end it up in this state?

                                      C 1 Reply Last reply
                                      0
                                      • C Offline
                                        C Offline
                                        cylon
                                        wrote on last edited by
                                        #19

                                        thanks for the help, but this is not urgent, I can wait for the update to the v8 so I won't have to do this change twice 🙂

                                        1 Reply Last reply
                                        0
                                        • girishG girish

                                          @cylon for v7, cloudron uses unbound. For Cloudron 7, please check this:

                                          • /etc/resolv.conf should have nameserver 127.0.0.1
                                          • systemctl status unbound should say running
                                          • host www.cloudron.io 127.0.0.1 should work

                                          systemd-resolved is not used at all. So, you can ignore all those related threads and configs. I would like to understand how it got to this state though? Do you think it tried to upgrade to v8 and end it up in this state?

                                          C Offline
                                          C Offline
                                          cylon
                                          wrote on last edited by
                                          #20

                                          @girish said in how to change DNS settings of my server ?:

                                          systemd-resolved is not used at all. So, you can ignore all those related threads and configs. I would like to understand how it got to this state though? Do you think it tried to upgrade to v8 and end it up in this state?

                                          That's possible, I don't remember if I first tried to upgrade to v8 or to change the DNS

                                          I updated the /etc/systemd/resolve.conf and only after did I check the /etc/resolv/conf file, I don't know what state it was before I updated /etc/systemd/resolve.conf

                                          1 Reply Last reply
                                          0
                                          Reply
                                          • Reply as topic
                                          Log in to reply
                                          • Oldest to Newest
                                          • Newest to Oldest
                                          • Most Votes


                                          • Login

                                          • Don't have an account? Register

                                          • Login or register to search.
                                          • First post
                                            Last post
                                          0
                                          • Categories
                                          • Recent
                                          • Tags
                                          • Popular
                                          • Bookmarks
                                          • Search