AskOverflow.Dev

AskOverflow.Dev Logo AskOverflow.Dev Logo

AskOverflow.Dev Navigation

  • 主页
  • 系统&网络
  • Ubuntu
  • Unix
  • DBA
  • Computer
  • Coding
  • LangChain

Mobile menu

Close
  • 主页
  • 系统&网络
    • 最新
    • 热门
    • 标签
  • Ubuntu
    • 最新
    • 热门
    • 标签
  • Unix
    • 最新
    • 标签
  • DBA
    • 最新
    • 标签
  • Computer
    • 最新
    • 标签
  • Coding
    • 最新
    • 标签
主页 / user-18444

Uyghur Lives Matter's questions

Martin Hope
Uyghur Lives Matter
Asked: 2019-02-06 13:13:01 +0800 CST

优先使用 VPN 的 DNS 服务器

  • 5

只有在通过网络管理器或其配置文件连接到 VPN (OpenVPN) 时,有没有办法优先考虑特定的 DNS 服务器?

我有一个192.168.1.*我经常连接的 VPN (),它配置了 DNS ( ),以解析其网络上192.168.1.53表单的主机名。*.internal.example.com我的本地路由器 ( 192.168.0.1) 上有 DD-WRT 和谷歌的 DNS 设置(这些不是严格需要的)。

我已经用/etc/resolv.conf符号链接替换了 systemd 存根,/run/systemd/resolve/resolv.conf以便主机名实际上可以使用 VPN 的 DNS 服务器进行解析。昨天它运行良好,因为 VPN 的 DNS 服务器位于列表的顶部。

# /etc/resolv.conf -> /run/systemd/resolve/resolv.conf
# This file is managed by man:systemd-resolved(8). Do not edit.
# ...

nameserver 192.168.1.53
nameserver 192.168.0.1
nameserver 8.8.8.8
# Too many DNS servers configured, the following entries may be ignored.
nameserver 8.8.4.4
search Home internal.example.com

但是,当我今天连接时,DNS 条目已重新排序。

# /etc/resolv.conf -> /run/systemd/resolve/resolv.conf
# This file is managed by man:systemd-resolved(8). Do not edit.
# ...

nameserver 192.168.0.1
nameserver 8.8.8.8
nameserver 8.8.4.4
# Too many DNS servers configured, the following entries may be ignored.
nameserver 192.168.1.53
search Home internal.example.com

重新启动后顺序经常更改。有时在重新连接到 VPN 时,我注意到订单发生了变化(在遇到解决问题之后)。

systemd-resolve工作得很好,可以使用正确的 DNS 服务器解析主机。

$ systemd-resolve --status --no-pager
Global
          DNSSEC NTA: ...

Link 10 (tun0)
      Current Scopes: DNS
       LLMNR setting: yes
MulticastDNS setting: no
      DNSSEC setting: no
    DNSSEC supported: no
         DNS Servers: 192.168.1.53
          DNS Domain: internal.example.com

Link 2 (eno1)
      Current Scopes: DNS
       LLMNR setting: yes
MulticastDNS setting: no
      DNSSEC setting: no
    DNSSEC supported: no
         DNS Servers: 192.168.0.1
                      8.8.8.8
                      8.8.4.4
                      192.168.1.53
          DNS Domain: Home
$ systemd-resolve srv1.internal.example.com
srv1.internal.example.com: 192.168.1.113

-- Information acquired via protocol DNS in 2.1ms.
-- Data is authenticated: no

ping, nslookup, 并且ssh都失败了。

$ ping srv1.internal.example.com
ping: srv1.internal.example.com: Name or service not known
$ nslookup srv1.internal.example.com
Server:         192.168.0.1
Address:        192.168.0.1#53

** server can't find srv1.internal.example.com: NXDOMAIN
$ ssh srv1.internal.example.com
ssh: Could not resolve hostname srv1.internal.example.com: Name or service not known

一些笔记。

我通过网络管理器连接到 VPN。我在 VPN 上手动指定了 VPN 的 DNS:IPv4 > DNS 服务器。

我尝试使用配置了 VPN 的 DNS 的单独有线以太网连接:IPv4 > 其他 DNS 服务器。

network-manager systemd systemd-resolved 18.04
  • 3 个回答
  • 8586 Views
Martin Hope
Uyghur Lives Matter
Asked: 2018-10-24 08:14:05 +0800 CST

Alt+拖动不聚焦窗口

  • 1

当我使用Alt+Mouse Left轻松拖动窗口时,目标窗口没有焦点。是否有某个设置可以使 alt+拖动的窗口自动聚焦而不求助于悬停?如果我只是单击并拖动窗口标题栏甚至菜单栏的空白,它会像我预期的那样聚焦。

kde kubuntu kwin plasma 18.04
  • 1 个回答
  • 443 Views
Martin Hope
Uyghur Lives Matter
Asked: 2018-09-09 12:46:01 +0800 CST

将 Grub 完全移动到新分区

  • 11

如何将 Grub 完全移动到新分区?当我安装 Ubuntu (Kubuntu) 时,我只为/boot分区分配了 256 MiB,这似乎还不够。每次安装新内核时,由于空间不足,安装会中途失败,因此我必须手动干预。因此,我试图将 grub 从我的旧引导分区 . 移动/dev/sdb5到我的新 512 MiB 分区/dev/sdb7.

我编辑/etc/fstab点使用新的引导分区。

# /boot was on /dev/sdb5 during installation
#UUID=f1fcbfbe-7943-4e48-9796-8d0c42076c0b      /boot   ext4    defaults        0       2
# /boot is now on /dev/sdb7
UUID=70d8be3a-6b6c-4722-ab0d-e79d93e6dd1c       /boot   ext4    defaults        0       2

我卸载了/boot/efi( /dev/sdb2) 和/boot( /dev/sdb5)。然后挂载/dev/sdb7为/boot,重新挂载/boot/efi,重新挂载/dev/sdb5为/mnt/boot。

我跑了:

$ sudo grub-install /dev/sdb7
Installing for x86_64-efi platform.
Installation finished. No error reported.

和:

$ sudo update-grub
Generating grub configuration file ...
Found Windows Boot Manager on /dev/sdb2@/EFI/Microsoft/Boot/bootmgfw.efi
Adding boot menu entry for EFI firmware configuration
done

但是,Linux 映像缺少/boot:

$ ls -1 /boot
efi
grub
lost+found

虽然旧/boot有:

$ ls -1 /mnt/boot/
abi-4.15.0-32-generic
abi-4.15.0-33-generic
config-4.15.0-32-generic
config-4.15.0-33-generic
efi
grub
initrd.img-4.15.0-33-generic
lost+found
memtest86+.bin
memtest86+.elf
memtest86+_multiboot.bin
retpoline-4.15.0-32-generic
retpoline-4.15.0-33-generic
System.map-4.15.0-32-generic
System.map-4.15.0-33-generic
vmlinuz-4.15.0-33-generic

我一定是错过了一步。执行此操作的正确过程是什么?我是否缺少重建 Linux 映像的命令?

注意:我想/boot成为一个单独的分区的/原因是因为/它是一个 LUKS 加密的 ext4 分区。


输出sudo fdisk -l:

Disk /dev/sda: 931.5 GiB, 1000204886016 bytes, 1953525168 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disklabel type: gpt
Disk identifier: CFE364AE-6B98-4A85-BE10-7E8A8833426F

Device         Start       End   Sectors   Size Type
/dev/sda1       2048 976762879 976760832 465.8G Microsoft basic data
/dev/sda2  976762880 977287167    524288   256M Linux filesystem


Disk /dev/sdb: 931.5 GiB, 1000204886016 bytes, 1953525168 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: gpt
Disk identifier: 1AB601E6-CACA-4A3F-828A-A334CC3564DF

Device          Start        End    Sectors   Size Type
/dev/sdb1        2048     923647     921600   450M Windows recovery environment
/dev/sdb2      923648    1128447     204800   100M EFI System
/dev/sdb3     1128448    1161215      32768    16M Microsoft reserved
/dev/sdb4     1161216 1534093311 1532932096   731G Microsoft basic data
/dev/sdb5  1534093312 1534617599     524288   256M Linux filesystem
/dev/sdb6  1534617600 1952475135  417857536 199.3G Linux filesystem
/dev/sdb7  1952475136 1953523711    1048576   512M Linux filesystem




Disk /dev/mapper/sdb6_crypt: 199.3 GiB, 213940961280 bytes, 417853440 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes

输出lsblk -lf:

NAME       FSTYPE      LABEL          UUID                                 MOUNTPOINT
sda                                                                        
sda1       ntfs        Extra Disk     54186D8E186D7042                     
sda2       ext4                       fae6b821-6644-4883-a2f1-da5c42485431 
sdb                                                                        
sdb1       ntfs        Recovery       44F21BC7F21BBC5C                     
sdb2       vfat                       941C-5A1E                            /boot/efi
sdb3                                                                       
sdb4       ntfs                       6C32289F3228706E                     
sdb5       ext4        Linux Boot Old f1fcbfbe-7943-4e48-9796-8d0c42076c0b /boot
sdb6       crypto_LUKS                b2d73541-783b-4336-a62c-1e11d0cc2b47 
sdb7       ext4        Linux Boot     70d8be3a-6b6c-4722-ab0d-e79d93e6dd1c 
sr0                                                                        
sdb6_crypt ext4        Linux Root     1e8b2b29-1857-4b38-84ee-d3c386f5085e /
grub2 boot 18.04
  • 3 个回答
  • 10881 Views

Sidebar

Stats

  • 问题 205573
  • 回答 270741
  • 最佳答案 135370
  • 用户 68524
  • 热门
  • 回答
  • Marko Smith

    如何运行 .sh 脚本?

    • 16 个回答
  • Marko Smith

    如何安装 .tar.gz(或 .tar.bz2)文件?

    • 14 个回答
  • Marko Smith

    如何列出所有已安装的软件包

    • 24 个回答
  • Marko Smith

    无法锁定管理目录 (/var/lib/dpkg/) 是另一个进程在使用它吗?

    • 25 个回答
  • Martin Hope
    Flimm 如何在没有 sudo 的情况下使用 docker? 2014-06-07 00:17:43 +0800 CST
  • Martin Hope
    Ivan 如何列出所有已安装的软件包 2010-12-17 18:08:49 +0800 CST
  • Martin Hope
    La Ode Adam Saputra 无法锁定管理目录 (/var/lib/dpkg/) 是另一个进程在使用它吗? 2010-11-30 18:12:48 +0800 CST
  • Martin Hope
    David Barry 如何从命令行确定目录(文件夹)的总大小? 2010-08-06 10:20:23 +0800 CST
  • Martin Hope
    jfoucher “以下软件包已被保留:”为什么以及如何解决? 2010-08-01 13:59:22 +0800 CST
  • Martin Hope
    David Ashford 如何删除 PPA? 2010-07-30 01:09:42 +0800 CST

热门标签

10.10 10.04 gnome networking server command-line package-management software-recommendation sound xorg

Explore

  • 主页
  • 问题
    • 最新
    • 热门
  • 标签
  • 帮助

Footer

AskOverflow.Dev

关于我们

  • 关于我们
  • 联系我们

Legal Stuff

  • Privacy Policy

Language

  • Pt
  • Server
  • Unix

© 2023 AskOverflow.DEV All Rights Reserve