Access to Discord and similar sites and ping problem solution [Ubuntu / Debian]

How to Use the Hostiger dnscrypt Installation Script

This script automates the installation and configuration of dnscrypt-proxy on your system. Here’s how to use it:

  1. Download the script: You can download the script using wget or curl:

    wget https://hostiger.com/scripts/hostiger_dnscrypt_install.sh
    # or
    curl -O https://hostiger.com/scripts/hostiger_dnscrypt_install.sh
    
  2. Make the script executable: Give the script execute permissions:

    chmod +x hostiger_dnscrypt_install.sh
    
  3. Run the script with root privileges: Execute the script using sudo:

    sudo ./hostiger_dnscrypt_install.sh
    
  4. Follow the on-screen instructions: The script will guide you through the installation process. It will ask you to select a resolver.

  5. Restart systemd-resolved: After the script finishes, restart the systemd-resolved service to apply the changes:

    sudo systemctl restart systemd-resolved
    

Important Notes:

  • This script is designed for Debian/Ubuntu-based systems.
  • Make sure your system is up-to-date before running the script: sudo apt update && sudo apt upgrade -y
  • You need root privileges (using sudo) to run the script.
  • The script automatically configures dnscrypt-proxy to start on boot.

Solution to access problems on some sites on Türkiye Location VPS.

 

 

Install DNSCrypt-Proxy (DEBİAN)

debian testing

sudo apt update && \
sudo apt install -t testing dnscrypt-proxy
debian unstable

sudo apt update && \
sudo apt install -t unstable dnscrypt-proxy

Install DNSCrypt-Proxy (UBUNTU)

DNSCrypt-Proxy 2.x is included in Ubuntu 18.10+ repositories, install it with

sudo apt install dnscrypt-proxy

 

Copy the example configuration files to /etc/dnscrypt-proxy/

/etc/dnscrypt-proxy/ is where the Debian/Ubuntu package expects the dnscrypt-proxy configuration to be.

So, type the following commands to copy the examples to that directory:

sudo cp /usr/share/doc/dnscrypt-proxy/examples/* /etc/dnscrypt-proxy/
cd /etc/dnscrypt-proxy
cp example-dnscrypt-proxy.toml dnscrypt-proxy.toml

The last step is important. You should overwrite the existing dnscrypt-proxy.toml with the example.

Check if the configuration is correct

Type:

cd /etc/dnscrypt-proxy
dnscrypt-proxy -check

Install the service

If everything appears to be working fine, stop the proxy by hitting Ctrl+C and/or by closing the terminal window.

Now, it’s time to configure it to start automatically at boot:

cd /etc/dnscrypt-proxy
sudo dnscrypt-proxy -service install
sudo dnscrypt-proxy -service start

Whenever you change the configuration, the service can be restarted with the following command:

sudo dnscrypt-proxy -service restart

Note that if you ever want to stop dnscrypt-proxy from running at boot (obviously, don’t do it now as the next steps wouldn’t work), type:

sudo dnscrypt-proxy -service stop
sudo dnscrypt-proxy -service uninstall

Configure the systemd DNS to use dnscryt-proxy

Type:

sudo nano /etc/systemd/resolved.conf

Locate the [Resolve] section. There should be a line like the following:

#DNS=

Replace it with:

DNS=127.0.0.1

Save the file, and restart the systemd DNS cache:

sudo systemctl restart systemd-resolved

Done! Your system is now using dnscrypt-proxy to secure and anonymize your DNS traffic.

Temporary failure in name resolution

Let’s break down the process of fixing the “Temporary failure in name resolution” error by modifying the /etc/resolv.conf file and restarting the systemd-resolved service.

Understanding the Problem: “Temporary failure in name resolution”

This error indicates that your system cannot translate domain names (like [geçersiz URL kaldırıldı]) into IP addresses (like 172.217.160.142). This translation is the job of the Domain Name System (DNS). When your system can’t reach a DNS server or there’s a problem with the DNS configuration, you encounter this error, preventing you from accessing websites and other network resources by name.

The Solution: Modifying /etc/resolv.conf and Restarting systemd-resolved

  1. /etc/resolv.conf – The DNS Configuration File: This file contains the DNS settings for your system. The most important setting here is nameserver, which specifies the IP address of a DNS server.

  2. Adding Google Public DNS Servers: By adding nameserver 8.8.8.8 and nameserver 8.8.4.4 to /etc/resolv.conf, you’re instructing your system to use Google Public DNS servers. These are reliable and widely available DNS servers.

    • 8.8.8.8: Google Public DNS primary server.
    • 8.8.4.4: Google Public DNS secondary server.
  3. The nano Command: sudo nano /etc/resolv.conf opens the /etc/resolv.conf file in the nano text editor with root privileges (required to modify system files).

  4. Restarting systemd-resolved: sudo systemctl restart systemd-resolved.service restarts the systemd-resolved service. This service is responsible for resolving domain names on systems using systemd (which is most modern Linux distributions). Restarting it ensures that the changes you made to /etc/resolv.conf are applied.

Step-by-step Instructions:

  1. Open your terminal.

  2. Edit the /etc/resolv.conf file:

    Bash

    sudo nano /etc/resolv.conf
    
  3. Add the following lines at the end of the file:

    nameserver 8.8.8.8
    nameserver 8.8.4.4
    

    If there are other nameserver lines in this file, adding these lines below them will prioritize Google’s DNS servers.

  4. Save the file (in nano, press Ctrl+X, then Y, then Enter).

  5. Restart the systemd-resolved service:

    Bash

    sudo systemctl restart systemd-resolved.service
    
  6. Test your internet connection by trying to access a website.

Important Note: On many modern Linux systems that use systemd-resolved, directly editing /etc/resolv.conf is not the recommended long-term solution. The file is often dynamically generated. Changes made directly to this file may be overwritten on reboot or network changes.

A More Permanent Solution (using resolved.conf):

A better approach is to modify /etc/systemd/resolved.conf and then restart the service.

  1. Edit /etc/systemd/resolved.conf:
    Bash

    sudo nano /etc/systemd/resolved.conf
    
  2. Uncomment (remove the #) and change the DNS= lines to:
    DNS=8.8.8.8 8.8.4.4
    #FallbackDNS=
    
  3. Restart the systemd-resolved service:
    Bash

    sudo systemctl restart systemd-resolved.service
    

This method ensures that your DNS settings persist across reboots.

Guide to Centos Installation and Root Access on CloudStack

Introduction After installing the Centos operating system on CloudStack, you usually log in with the username centos. However, in some cases, root access may be required. This guide explains step-by-step how to log in to the system with the centos user, obtain root access, and optionally create a password for the root user.

Step-by-Step Guide

  1. Log in with the Centos User:

    • Connect to the Centos server you created in the CloudStack console using SSH or VNC.
    • Log in using the username centos and your password.
  2. Root Access with the Sudo Command:

    • Run the following command in the terminal:
      Bash

      sudo -s
      
    • This command gives you root privileges. You can now run commands as the root user.
  3. Create a Root Password (Optional):

    • Why Create a Root Password: For security reasons, it’s important to create a password for the root user. This prevents unauthorized access to the root account.
    • Create Password:
      Bash

      passwd
      

      This command will prompt you to enter a new password. Make sure you create a strong password.

  4. Direct Login with the Root User (Optional):

    • SSH Configuration:
      • Open the SSH configuration file:
        Bash

        nano /etc/ssh/sshd_config
        
      • Find the following line and change the value to yes:
        PermitRootLogin yes
        
      • Save the file by pressing Ctrl+X, then Y, and Enter.
      • Restart the SSH service:
        Bash

        systemctl restart sshd
        
    • You can now log in directly to the system using the root username and the new password you created.

Important Notes:

  • Security: Be careful with root privileges. Incorrect commands can crash your system.
  • Sudoers File: If you have multiple users on your system, you can edit the sudoers file to define which users can run which commands.
  • SSH Key: We recommend using SSH keys for a more secure login.
  • Strong Password: Create a strong and unique password for the root user.