• Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Register
  • Login
UBports Robot Logo UBports Forum
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Register
  • Login

Set DNS in UT

Scheduled Pinned Locked Moved Support
18 Posts 6 Posters 2.2k Views 8 Watching
Loading More Posts
  • 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
      Capsia
      last edited by 24 Feb 2020, 13:18

      Hi,
      is it possible to set the default dns provider in UT?
      It would be nice to have a setting for this.

      I would use OpenDNS as default.

      Thanks

      S 1 Reply Last reply 24 Feb 2020, 13:23 Reply Quote 0
      • S Offline
        stan @Capsia
        last edited by 24 Feb 2020, 13:23

        @Capsia may i ask you please about the benefit of that ?
        my learning curve is still not high enough

        1 Reply Last reply Reply Quote 0
        • C Offline
          Capsia
          last edited by 24 Feb 2020, 13:36

          @stan the DNS resolves website names (like example.com) to IP addresses (like 1.1.1.1). Using a custom set dns is usually better than the one provided by ISP, because it is probably faster. Some DNS providers also offer some privacy protections, traffic encryption, phishing protections, website blacklisting, parental control, stats, ...

          S 1 Reply Last reply 24 Feb 2020, 13:40 Reply Quote 0
          • S Offline
            stan @Capsia
            last edited by 24 Feb 2020, 13:40

            @Capsia that sound very useful i'm now watching this thread thank you very much

            1 Reply Last reply Reply Quote 0
            • O Offline
              Opolork
              last edited by Opolork 24 Feb 2020, 17:14

              I've changed this thread to Watching - I too would like a way.

              BTW - I'd opt for:
              CloudFlare:

              1.1.1.1, 1.0.0.1
              2606:4700:4700::1111 
              2606:4700:4700::1001
              

              How can you trust that an app really won't send some company your location data, when you tell it not to? The only way you can trust a program not to do something it isn't supposed to do is if it is free software. ~ RMS

              1 Reply Last reply Reply Quote 0
              • F Offline
                flohack
                last edited by 24 Feb 2020, 17:51

                Ubuntu Touch does the same as Ubuntu - it uses all the magic from NetworkManager to listen for dhcp and configure the DNS according to the responses. So the question is a more general one - how you would do it on Ubuntu Desktop?

                My languages: πŸ‡¦πŸ‡Ή πŸ‡©πŸ‡ͺ πŸ‡¬πŸ‡§ πŸ‡ΊπŸ‡Έ

                S 1 Reply Last reply 24 Feb 2020, 17:55 Reply Quote 0
                • S Offline
                  stan @flohack
                  last edited by 24 Feb 2020, 17:55

                  @Flohack yes please how πŸ™‚ ?

                  1 Reply Last reply Reply Quote 0
                  • C Offline
                    Capsia
                    last edited by 27 Feb 2020, 14:19

                    @Flohack On Ubuntu desktop I've changed DNS with the tool nm-connection-editor in Unity or in the Gnome settings. I've tried to set DNS using nmcli both on desktop and on UT.

                    The results:
                    Desktop was able to set DNS for ethernet and wireless network correctly
                    UT: changed DNS for wireless successfully but unable to change it in gsm mobile network

                    The following error occurred when attempting to save connection settings:

                    Failed to save '/222071071843368/context1' (628f4269-3a24-7858-e4b0-3765d485ecda) connection: Connection is read-only
                    
                    A 1 Reply Last reply 28 Feb 2020, 13:21 Reply Quote 0
                    • A Offline
                      adeliepenguin @Capsia
                      last edited by 28 Feb 2020, 13:21

                      @Capsia said in Set DNS in UT:

                      UT: changed DNS for wireless successfully but unable to change it in gsm mobile network

                      The following error occurred when attempting to save connection settings:
                      [...]

                      Just guessing: maybe the root file system has to write-enabled to save this?

                      Nexus 5 16.04 OTA-12 stable, PinePhone UBports CE

                      1 Reply Last reply Reply Quote 0
                      • C Offline
                        Capsia
                        last edited by 28 Feb 2020, 13:33

                        @adeliepenguin said in Set DNS in UT:

                        Just guessing: maybe the root file system has to write-enabled to save this?

                        I've tried to do it with root in rw and I've got the same results.
                        Also tried using sudo.

                        The commands I've used:

                        nmcli c modify 628f4269-3a24-7858-e4b0-3765d485ecda ipv4.dns "208.67.222.222, 208.67.220.220"
                        nmcli c modify 628f4269-3a24-7858-e4b0-3765d485ecda ipv4.ignore-auto-dns yes
                        

                        Get network ID with:

                        nmcli c
                        
                        A 1 Reply Last reply 28 Feb 2020, 17:14 Reply Quote 0
                        • A Offline
                          adeliepenguin @Capsia
                          last edited by 28 Feb 2020, 17:14

                          @Capsia I didn't know about nmcli so far. Thanks! Network-manager has been a mystery to me. I also would like to set my own dns. I haven't found a solution yet but wanted to mention what I found: I get the same as you (connection is read-only even with root r/w). I gues this is not a lack of permissions, but a feature. The command

                          nmcli -p con show f651d7ab-521b-e3e9-f9fa-721e2b64ec45
                          

                          lists the connection as read-only (mobile data / gsm). Maybe there's a nmcli command to make it writable. I didn't find one so far. (I'm desperately missing man pages in UbuntuTouch; didn't manage to install them in libertine, either.)

                          Nexus 5 16.04 OTA-12 stable, PinePhone UBports CE

                          A 1 Reply Last reply 5 Mar 2020, 23:45 Reply Quote 0
                          • C Offline
                            Capsia
                            last edited by 29 Feb 2020, 17:49

                            @adeliepenguin said in Set DNS in UT:

                            I gues this is not a lack of permissions, but a feature

                            This is probably because the gsm connection isn't managed by the NetworkManager.
                            I think it is managed by ofono, but I might be wrong.

                            1 Reply Last reply Reply Quote 0
                            • A Offline
                              adeliepenguin @adeliepenguin
                              last edited by 5 Mar 2020, 23:45

                              @adeliepenguin said in Set DNS in UT:

                              [nmcli ...]
                              lists the connection as read-only (mobile data / gsm). Maybe there's a nmcli command to make it writable. I didn't find one so far.

                              (The following also applies to mobile data only, not WLAN.)

                              In case anyone is interested: The command would be

                              nmcli c m  f651d7ab-521b-e3e9-f9fa-721e2b64ec45 connection.read-only no
                              

                              But it does not have the desired effect. The output is "Error: failed to modify connection.read-only: the property can't be changed."

                              From the nmcli docu:

                              Key Name: read-only
                              Value Type: boolean
                              Default Value: FALSE
                              Value Description: FALSE if the connection can be modified using the provided settings service's D-Bus interface with the right privileges, or TRUE if the connection is read-only and cannot be modified.

                              I've done some reading, and I'm quite sure now the read-only property was set intentionally. I found lots of tutorials, but all the places where configs and connections should be stored are empty on my device. (I haven't used wifi so far, so that left no traces, either.) Since a phone has a built-in gsm connection, I suppose this connection has been pre-defined with a default config in UT, not expecting that anybody would want to modify it. (Just upgraded to RC66 today, no difference.)

                              From what I learned, it's really network-manager who is in charge here. It has a plug-in to talk to ofono for modem use, and eventually delegates DNS to dnsmasq (local DNS service). Setting a custom DNS server would be done exactly with the commands @Capsia posted - if this was allowed.

                              BTW, I especially liked this tutorial (albeit it did not help me in the end):
                              https://www.redhat.com/sysadmin/becoming-friends-networkmanager

                              Nexus 5 16.04 OTA-12 stable, PinePhone UBports CE

                              1 Reply Last reply Reply Quote 0
                              • G Offline
                                Giiba
                                last edited by Giiba 3 Jun 2020, 03:10 6 Mar 2020, 03:10

                                Maybe a dumb question, but have you run those commands with:

                                $ sudo
                                

                                ?

                                A 1 Reply Last reply 6 Mar 2020, 15:11 Reply Quote 0
                                • A Offline
                                  adeliepenguin @Giiba
                                  last edited by 6 Mar 2020, 15:11

                                  @Giiba you're right, one should try everything before giving up. πŸ˜‰ I re-tried with sudo and root r/w, but it made no difference. (According to its docs, nmcli should be run as a user.)

                                  I wonder how the image for OTA updates is being made. Are there any docs on this? I used to run a LTSP server with disk-less clients and also made some custom live DVDs, so I'm not afraid of the read-only root file system. But configuring either of those was fairly easy, since in the end, it was just a directory tree with a nearly vanilla Linux, plus some clever scripts (pre-written) to wrap it up. I suppose there are more stages required for UbuntuTouch, cross-compiling at the very least.
                                  What about generating one's own image of UbuntuTouch? I know it would involve a high risk of bricking my device, so I'd probably not do it, but I'm really curious here.

                                  Nexus 5 16.04 OTA-12 stable, PinePhone UBports CE

                                  1 Reply Last reply Reply Quote 0
                                  • C Offline
                                    Capsia
                                    last edited by 6 Mar 2020, 21:51

                                    @adeliepenguin said in Set DNS in UT:

                                    but all the places where configs and connections should be stored are empty on my device.

                                    The configs for wifi networks are stored in:

                                    /userdata/system-data/etc/NetworkManager/system-connections

                                    I think they are here because /userdata won't be overwritten with ota update

                                    Ofono configs:

                                    /userdata/system-data/var/lib/ofono

                                    There are no configs for gsm network in the NetworkManager directory. I think, this is because gsm networks are read-only in NM

                                    https://www.redhat.com/sysadmin/becoming-friends-networkmanager

                                    @adeliepenguin Thanks, very nice tutorial

                                    1 Reply Last reply Reply Quote 0
                                    • S Offline
                                      stan
                                      last edited by 19 Apr 2020, 18:10

                                      so any success on setting up the DNS

                                      C 1 Reply Last reply 19 Apr 2020, 20:33 Reply Quote 0
                                      • C Offline
                                        Capsia @stan
                                        last edited by 19 Apr 2020, 20:33

                                        @stan Yes and no, I've set correctly the DNS for Wi-Fi networks, but can't edit the settings for cellular data.
                                        For wireless you can find the commands I've used above.
                                        Maybe it could be part of the settings app in the future.

                                        1 Reply Last reply Reply Quote 1
                                        • First post
                                          Last post