当前位置: 首页 > news >正文

网站站点连接不安全东莞网站建设 胶粘包装材料

网站站点连接不安全,东莞网站建设 胶粘包装材料,wordpress 重定位,域名注册好了怎么打开网站总结 1、ubuntu修改服务器名重启后生效的方法是直接修改/etc/hostname文件 2、ubuntu 22.04操作系统配置ip和dns信息#xff0c;一般只需要使用netplan命令行工具来配置就行#xff0c;在/etc/netplan/在目录下创建一个yaml文件就可以实现ip和dns的配置#xff0c;当然如果…总结 1、ubuntu修改服务器名重启后生效的方法是直接修改/etc/hostname文件 2、ubuntu 22.04操作系统配置ip和dns信息一般只需要使用netplan命令行工具来配置就行在/etc/netplan/在目录下创建一个yaml文件就可以实现ip和dns的配置当然如果/etc/netplan下有多个yaml文件则所有/etc/netplan/*.yaml文件都将被netplan命令行使用参见官方文档https://ubuntu.com/server/docs/network-configuration和https://manpages.ubuntu.com/manpages/jammy/man5/netplan.5.html 3、个人不建议使用/etc/resolve.conf来配置ubuntu 22.04操作系统的dns信息因为太复杂了这个文件是被systemd-resolved服务托管。ubuntu操作系统/etc/resolve.conf中默认使用的是 nameserver 127.0.0.53回环地址,/etc/resolve.conf文中有这么一句话This is /run/systemd/resolve/stub-resolv.conf managed by man:systemd-resolved(8). Do not edit。说明这个文件是被systemd-resolved这个服务托管的。通过 netstat -tnpl| grep systemd-resolved 查看到这个服务是监听在 53 号端口上。为啥要用127.0.0.53作为回环地址而不是127.0.0.1因为127网段都是回环地址(127.0.0.1 - 127.255.255.254),不过通常用大家只喜欢用127.0.0.1来表示而已53表示dns端口 3.1、新安装的ubuntu 22.04环境不做其他改动的情况下/etc/resolv.conf是/run/systemd/resolve/stub-resolv.conf的软链接如果只是手工更改/etc/resolv.conf中的内容重启会后发现/etc/resolv.conf中的内容又恢复成原样了比如注释/etc/resolv.conf文件中的nameserver 127.0.0.53这一行重启系统后被注释掉的nameserver 127.0.0.53这一行又回来了如果不想重启后/etc/resolv.conf中的内容恢复成原样则执行systemctl stop systemd-resolved和systemctl disable systemd-resolved或把/etc/resolv.conf对应的软链接删除再手工建立一个/etc/resolv.conf 3.2、使用/etc/netplan/00-installer-config.yaml配置DNS 172.22.10.66并执行netplan apply使之生效再修改/etc/systemd/resolved.conf内容里的DNS为172.22.136.2然后执行systemctl restart systemd-resolved发现/etc/resolv.conf中的内容没变还是127.0.0.53再执行resolvectl status可以看到/etc/systemd/resolved.conf中的DNS 172.22.136.2存在/etc/netplan/00-installer-config.yaml中的DNS 172.22.10.66也在就是没有/etc/resolv.conf中的127.0.0.53。重启操作系统后/etc/resolv.conf中的内容没变还是127.0.0.53重启操作系统后执行resolvectl status还是只有/etc/systemd/resolved.conf中的DNS 172.22.136.2和/etc/netplan/00-installer-config.yaml中的DNS 172.22.10.66没有/etc/resolv.conf中的127.0.0.53 4、ubuntu官方不建议使用/etc/resolve.conf来配置ubuntu 的dns信息ubuntu对于/etc/resolv.conf的官方描述If you require DNS for your temporary network configuration, you can add DNS server IP addresses in the file /etc/resolv.conf. In general, editing /etc/resolv.conf directly is not recommended, but this is a temporary and non-persistent configuration. 5、ubuntu 22.04查看dns信息的命令是resolvectl status该命令可以看到全局dns信息和某个网卡的dns信息全局DNS服务器信息一般来自配置文件/etc/systemd/resolved.conf,仅在/etc/resolv.conf不是一个指向/run/systemd/resolve/stub-resolv.conf, /usr/lib/systemd/resolv.conf, /run/systemd/resolve/resolv.conf 之一的软连接的情况下且/etc/systemd/resolved.conf中dns被注释掉的情况下全局DNS服务器才会读取自/etc/resolv.conf所以这就是不建议大家使用/etc/resolve.conf来配置ubuntu 的dns信息的原因。 修改服务器名 修改服务器名为FRSBachDEV3重启后也生效的方法 vi /etc/hostname FRSBachDEV3 备注如果/etc/hostname文件中的内容写成hostname FRSBachDEV3那么重启后服务器名就变成了hostnameFRSBachDEV3 修改IP https://ubuntu.com/server/docs/network-configuration https://manpages.ubuntu.com/manpages/jammy/man5/netplan.5.html netplan是一个命令行工具用于ubuntu上配置网络所有/etc/netplan/*.yaml文件都将被使用 rootFRSBachDEV3:~# cat /etc/netplan/00-installer-config.yaml network:ethernets:ens160:dhcp4: trueversion: 2rootFRSBachDEV3:~# vim /etc/netplan/00-installer-config.yaml network:ethernets:ens160:dhcp4: falseaddresses: [172.22.136.147/22]routes:- to: defaultvia: 172.22.136.1nameservers:search: [dai.netdai.com,netdai.com]addresses: [172.22.10.66,172.22.10.67]version: 2备注 dhcp4中的4表示ipv4 gateway4中的4表示ipv4不过gateway4已经被废弃配置了gateway4再执行netplan apply的话会报错** (generate:1426): WARNING **: 09:54:13.918: gateway4 has been deprecated, use default routes instead.See the ‘Default routes’ section of the documentation for more details. routes项填写网关地址 addresses项填写ip地址 nameservers项填写dns地址或搜索域其中addresses子项是dns地址列表search子项是搜索域名列表 version: 2这一项表示YAML版本是2curtin,MaaS等目前使用的YAML的版本是1 rootFRSBachDEV3:~# netplan applyrootFRSBachDEV3:~# cat /etc/resolv.conf nameserver 127.0.0.53 options edns0 trust-ad search dai.netdai.com netdai.comrootFRSBachDEV3:~# ifconfig ens160: flags4163UP,BROADCAST,RUNNING,MULTICAST mtu 1500inet 172.22.136.147 netmask 255.255.252.0 broadcast 172.22.139.255inet6 fe80::250:56ff:fe94:522d prefixlen 64 scopeid 0x20linkether 00:50:56:94:52:2d txqueuelen 1000 (Ethernet)RX packets 45071 bytes 3394009 (3.3 MB)RX errors 0 dropped 40 overruns 0 frame 0TX packets 765 bytes 78732 (78.7 KB)TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0lo: flags73UP,LOOPBACK,RUNNING mtu 65536inet 127.0.0.1 netmask 255.0.0.0inet6 ::1 prefixlen 128 scopeid 0x10hostloop txqueuelen 1000 (Local Loopback)RX packets 2331 bytes 168025 (168.0 KB)RX errors 0 dropped 0 overruns 0 frame 0TX packets 2331 bytes 168025 (168.0 KB)TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0查看网关 rootFRSBachDEV3:~# ip route | grep default default via 172.22.136.1 dev ens160 proto staticrootFRSBachDEV3:~# nmcli dev show|grep GATEWAY IP4.GATEWAY: 172.22.136.1 IP6.GATEWAY: -- IP4.GATEWAY: -- IP6.GATEWAY: --查看dns rootFRSBachDEV3:~# resolvectl status GlobalProtocols: -LLMNR -mDNS -DNSOverTLS DNSSECno/unsupported resolv.conf mode: stubLink 2 (ens160)Current Scopes: DNSProtocols: DefaultRoute LLMNR -mDNS -DNSOverTLS DNSSECno/unsupported Current DNS Server: 172.22.10.66DNS Servers: 172.22.10.66 172.22.10.67DNS Domain: dai.netdai.com netdai.com实验如何才会使用到/etc/resolve.conf中的dns信息 /etc/systemd/resolved.conf中dns为172.22.136.2 rootFRSBachDEV3:~# cat /etc/systemd/resolved.conf |grep DNS DNS172.22.136.2/etc/resolv.conf来自软链接/run/systemd/resolve/stub-resolv.conf rootFRSBachDEV3:~# ll /etc/resolv.conf lrwxrwxrwx 1 root root 39 Aug 9 2022 /etc/resolv.conf - ../run/systemd/resolve/stub-resolv.confrootFRSBachDEV3:~# cat /run/systemd/resolve/stub-resolv.conf nameserver 127.0.0.53 options edns0 trust-ad search dai.netdai.com netdai.com/run/systemd/resolve/resolv.conf有来自/etc/systemd/resolved.conf中dns 172.22.136.2也有来自/etc/netplan/00-installer-config.yaml中dns 172.22.10.66 172.22.10.67就是没有来自/etc/resolv.conf的127.0.0.53 rootFRSBachDEV3:~# cat /run/systemd/resolve/resolv.conf nameserver 172.22.136.2 nameserver 172.22.10.66 nameserver 172.22.10.67 search dai.netdai.com netdai.com/etc/systemd/resolved.conf中dns 172.22.136.2和/etc/netplan/00-installer-config.yaml中dns 172.22.10.66 172.22.10.67就是没有来自/etc/resolv.conf的127.0.0.53 rootFRSBachDEV3:~# resolvectl status GlobalProtocols: -LLMNR -mDNS -DNSOverTLS DNSSECno/unsupportedresolv.conf mode: stub Current DNS Server: 172.22.136.2DNS Servers: 172.22.136.2Link 2 (ens160)Current Scopes: DNSProtocols: DefaultRoute LLMNR -mDNS -DNSOverTLS DNSSECno/unsupported Current DNS Server: 172.22.10.66DNS Servers: 172.22.10.66 172.22.10.67DNS Domain: dai.netdai.com netdai.com删除/etc/resolv.conf来自软链接并手工建立/etc/resolv.conf文件其中dns为172.22.136.3 rootFRSBachDEV3:~# ll /etc/resolv.conf -rw-r--r-- 1 root root 946 Oct 12 10:49 /etc/resolv.confrootFRSBachDEV3:~# cat /etc/resolv.conf nameserver 172.22.136.3 options edns0 trust-ad search dai.netdai.com netdai.com保留/etc/systemd/resolved.conf中dns 172.22.136.2的情况下重启systemd-resolved发现还是用的/etc/systemd/resolved.conf中dns 172.22.136.2而没有使用手工建立/etc/resolv.conf文件的dns 172.22.136.3 rootFRSBachDEV3:~# systemctl restart systemd-resolved rootFRSBachDEV3:~# resolvectl status GlobalProtocols: -LLMNR -mDNS -DNSOverTLS DNSSECno/unsupported resolv.conf mode: foreignDNS Servers: 172.22.136.2Link 2 (ens160) Current Scopes: DNSProtocols: DefaultRoute LLMNR -mDNS -DNSOverTLS DNSSECno/unsupportedDNS Servers: 172.22.10.66 172.22.10.67DNS Domain: dai.netdai.com netdai.com注释掉/etc/systemd/resolved.conf中dns再重启systemd-resolved发现这个时候才真正用上了手工建立/etc/resolv.conf文件的dns 172.22.136.3 rootFRSBachDEV3:~# vim /etc/systemd/resolved.conf rootFRSBachDEV3:~# cat /etc/systemd/resolved.conf |grep DNS #DNSrootFRSBachDEV3:~# systemctl restart systemd-resolved rootFRSBachDEV3:~# resolvectl status GlobalProtocols: -LLMNR -mDNS -DNSOverTLS DNSSECno/unsupportedresolv.conf mode: foreign Current DNS Server: 172.22.136.3DNS Servers: 172.22.136.3DNS Domain: dai.netdai.com netdai.comLink 2 (ens160) Current Scopes: DNSProtocols: DefaultRoute LLMNR -mDNS -DNSOverTLS DNSSECno/unsupportedDNS Servers: 172.22.10.66 172.22.10.67DNS Domain: dai.netdai.com netdai.comrootFRSBachDEV3:~# cat /run/systemd/resolve/resolv.conf nameserver 172.22.136.3 nameserver 172.22.10.66 nameserver 172.22.10.67 search dai.netdai.com netdai.com
http://www.zqtcl.cn/news/472031/

相关文章:

  • 网站设计优化重庆教育建设有限公司网站
  • 域名注册网站查询手工制作视频教程简单又漂亮
  • 书画院网站源码网站百度指数
  • 网页设计与网站开发第三版课后答案网络运营商是干嘛的
  • wordpress分类目录网站主题自己做营销型网站
  • 简述网站推广的五要素seo排名软件怎么做
  • 做网站能做职业吗织梦如何做几种语言的网站
  • 手机网站定制咨询如何修改网站
  • 长沙大型网站建设公司建站工作室源码
  • 找设计方案的网站专注南昌网站建设
  • UE做的比较好的网站汕头网站关键词优化教程
  • 做羞羞的事情网站广州番禺招聘网最新招聘信息
  • 网站基础开发成本网站建设策划包括哪些内容
  • 商务网站建设哪家好绍兴网站建设做网站
  • 网站域名管理东莞网页设计和网页制作
  • 网站建设与制作报价网站app制作
  • 下载可以做动漫的我的世界视频网站长沙网站seo技巧
  • 汕头网站制作推荐制作影视视频的软件
  • 定制程序网站宁波英文网站建设
  • 安康公司做网站网页设计怎么设计
  • 小型企业网站系统南京seo外包平台
  • 曲靖网站制作邢台网站制作那家便宜
  • wordpress中portfolio重庆网站seo按天计费
  • 做淘客网站需要多大的空间工程公司名称大全简单大气
  • 康县建设局网站网站做优化
  • 笔记网站开发代码下载了wordpress后
  • 北京招聘高级网站开发工程师域名最新通知
  • 企业如何实现高端网站建设西安百度推广开户
  • 广西城乡住房建设厅网站首页本地 安装 WordPress主题
  • 网站开发 技术方案设计一个软件需要多少钱