首页 > 系统相关 >2、linux增加域名代替ip

2、linux增加域名代替ip

时间:2024-01-31 18:15:20浏览次数:17  
标签:ip 192.168 etc 域名 linux localhost

linux增加域名代替ip

1、查看当前的域名配置列表

cat /etc/hosts

2、配置域名

vi /etc/hosts

/etc/hosts:

192.168.0.10为当前服务器ip

192.168.0.20为配置其他服务ip

127.0.0.1   localhost localhost.localdomain localhost4 localhost4.localdomain4
::1         localhost localhost.localdomain localhost6 localhost6.localdomain6
192.168.0.10 appServer10
192.168.0.20 dbserver20

标签:ip,192.168,etc,域名,linux,localhost
From: https://www.cnblogs.com/lgxdev/p/17999842

相关文章

  • Linux 中 mkdir -p选项
     001、测试1[root@pc1test1]#ls[root@pc1test1]#mkdira/b/c##mkdir创建连续目录,失败mkdir:cannotcreatedirectory‘a/b/c’:Nosuchfileordirectory[root@pc1test1]#ls[root@pc1test1]#mkdir-pa/b/c##增加-p选项,表示传递......
  • [word] Word for iPad日常使用体验及吐槽分享
    现在平板上写Word文章也可以有不错的体验。当iPadOS来了后,微软进一步增强了Word的功能。现在在平板上使用Word打字顺得很,加上云盘的历史记录保存,加上WORD丰富的第三方插件:比如手写数学公式,再加上iPadOS原生的实体键盘五笔加持,加上ApplePencil的手写标注,再加上iPad的便携性,使得现在......
  • Pass Artifact between tfx compoents when running with kubeflow pipeline
    WhatisArtifact?AnArtifactisafileordirectoryproducedbyatfxcomponent,whichcanbepassedtoadownstreamcomponent,andthenthedownstreamcomponentcanuseit.HowdoestfxpassanArtifactbetweencomponents?tfxpipelinehasanargument......
  • linux 中 awk命令输出一列中多个类别中各项首次或者最后一次出现的项
     001、输出首次出现的项[root@pc1test1]#lstest.map[root@pc1test1]#cattest.map##测试数据1559101852041122948216712721760792361433314401031999103234281......
  • Linux修改 SSH 端口
    1.编辑sshd配置,修改默认的端口。vi/etc/ssh/sshd_config找到配置端口号的位置,可在命令行模式下输入'?#Port22'进行查找。详细命令可查看Linuxvi/vim#Port22修改为:Port22Port10022#变更后的端口这样做防止10022端口不能连接的情况下还可以使用22端口连接,保存退出......
  • Linux中 awk命令输出一列多个类别中 每个类别中最大的项
     001、(base)[b20223040323@admin1test]$lsa.txt(base)[b20223040323@admin1test]$cata.txt##测试数据a88a76b88c10b777c200a87c150a34b25a66##输出第一列中每一类别中值最大的项(base)[b20223040......
  • 洛谷题单指南-暴力枚举-P1088 [NOIP2004 普及组] 火星人
    原题链接:https://www.luogu.com.cn/problem/P1088题意解读:火星人的手指可以通过全排列来表示数字,全排列由小到大的顺序即为表示的数字大小,题目可以转化为:给定按顺序全排列中的某一个排列,求往后数m个排列的内容。解题思路:此题与经典全排列问题的差异在于,需要从指定一个排列开......
  • [Typescript] The type Registry pattern (declare module)
    OurprojectmighthaveafilestructurelikeOurprojectmighthaveafilestructurelikedata/book.ts//AmodelforBookrecordsmagazine.ts//AmodelforMagazinerecordslib/registry.ts//Ourtyperegistry,anda`fetchRecord`f......
  • linux安装jdk17
    下载安装包cd/usr/local/jdkwgethttps://download.oracle.com/java/17/latest/jdk-17_linux-x64_bin.tar.gz-P/usr/local/jdk/或wgethttp://49.232.8.65/jdk/jdk17/jdk-17_linux-x64_bin.tar.gz-P/usr/local/jdk/解压tarxf/usr/local/jdk-17_linux-x64_bin.tar......
  • Applescript成功实现imessage数据筛选,imessage蓝号检测,无痕检测手机号是否注册imess
    一、imessages数据检测的两种方式:1.人工筛选,将要验证的号码输出到文件中,以逗号分隔。再将文件中的号码粘贴到iMessage客户端的地址栏,iMessage客户端会自动逐个检验该号码是否为iMessage账号,检验速度视网速而定。红色表示不是iMessage账号,蓝色表示iMessage账号。2.编写苹果MacO......