how to change DNS settings of my server ?
-
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 writingWhen 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 **********************************************************************
-
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 -
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 -
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 ? -
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 not9.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 ? -
-
@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. - Make sure resolvconf package is not there . We don't install this anymore intentionally.
-
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/ -
I'm still indeed on v7, but I can't update to v8
https://forum.cloudron.io/post/93010 -
@cylon for v7, cloudron uses unbound. For Cloudron 7, please check this:
/etc/resolv.conf
should havenameserver 127.0.0.1
systemctl status unbound
should say runninghost 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? -
@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