- 浏览: 1308821 次
- 性别:
- 来自: 北京
文章分类
- 全部博客 (732)
- Java_about (146)
- Spring_Hibernate_Struts_OpenSource (27)
- linux_unix (62)
- life_sth (22)
- js_css_html_xml_nodejs (69)
- design_pattens (1)
- Perl (8)
- php_ecshop (4)
- DB_Mysql_Oracle_Informix_SqlServer (43)
- JSTL (8)
- Testing_自动化测试 (42)
- DB_ID_UUID (4)
- SEM_SEO (1)
- english_study_improvement (4)
- SVN_Git (9)
- WebService_SOA_CloudComputing (3)
- E-Commerce (1)
- Lucene_Solr (7)
- others (2)
- Regex (2)
- tomcat_jetty (8)
- zeroc-ice (1)
- java_excel (5)
- ant_maven_gradle (5)
- Unity_VR_AR_C# (2)
- jmeter (1)
- XPath_dom4j (1)
- Ruby_and_Rails (68)
- write_a_rails (17)
- manage_and_team (1)
- getting_real (1)
- ubuntu (20)
- git_and_git_flow (7)
- TODO (1)
- PM_design (2)
- Python_and_Django (8)
- NoSql_mongo_redis (24)
- C/C++ (3)
- vi_vim_gvim (0)
- c#_.Net_windows编程_dll (10)
- Php_and_Yii (9)
- Android_IOS (31)
- Mysql (5)
- sa_运维_network_硬件 (37)
- lua (2)
- c_cpp_VisualStudio (21)
- 硬件-RM-Arduino (6)
最新评论
-
shenkun58:
...
NoClassDefFoundError: Could not initialize springframework.BeanCreationException -
liaojia1:
正解,感谢
NoClassDefFoundError: Could not initialize springframework.BeanCreationException -
flingfox63:
谢谢分享,电脑上有IPV6,导致了Guard启动不了……
ruby错误解决: Address family not supported by protocol - connect(2) -
c39274936:
s = "hello_world_ruby" ...
驼峰格式和下划线格式转换_translation between camel and snake format -
yfj300:
学习了学习了学习了学习了
硬盘基本知识(磁道、扇区、柱面、磁头数、簇、MBR、DBR)
另外:修改hosts文件 立即生效 linux ubuntu windows
大概原因是:应该是dnscache服务cache了dns查询结果。
方法一:命令行(cmd)运行:ipconfig /flushdns #清除DNS缓存内容。
ps:ipconfig /displaydns //显示DNS缓存内容
DnsCacheTimeout 0x0 (REG_DWORD)
ServerInfoTimeOut 0x0 (REG_DWORD) 这三个DWORD。
如果是使用Firefox浏览器,强烈推荐DNS Flusher插件,换了hosts绑定后,只需要使用一下这个插件,就会使HOST绑定立即生效;非常好用的!~
另外,在Linux下修改/etc/hosts,若想要它立刻生效,运行source /etc/hosts应该就可以了(这涉及到source命令的功能,下次再总结一下吧)[me补充:应该是立即生效的]
修改hostname
Normally we will set the hostname of a system during the installation process. Many peoples don’t care about this, and don’t change the hostname even if for example this was set to something really stupid by the datacenter that installed the system (most likely they will set this to “debian” on any debian installation, etc). For me, it is important to see on each one of the ssh screens I will have open at any time a different hostname that is relevant and will give me quickly the information on what system I am logged in.
Change the hostname on a running system
On any Linux system you can change its hostname with the command ‘hostname ‘ (surprised?)… Here are some quick usages of the command line hostname:
hostname
without any parameter it will output the current hostname of the system.
hostname --fqd
it will output the fully qualified domain name (or FQDN) of the system.
will set the hostname of the system to NEW_NAME. This is active right away and will remain like that until the system will be rebooted (because at system boot it will set this from some particular file configurations – see bellow how to set this permanently). You will most probably need to exit the current shell in order to see the change in your shell prompt.
Permanent hostname change on Debian based systems
Debian based systems use the file /etc/hostname to read the hostname of the system at boot time and set it up using the init script /etc/init.d/hostname.sh
/etc/hostname
输出:june-desktop
So on a Debian based system we can edit the file /etc/hostname and change the name of the system and then run:
/etc/init.d/hostname.sh start
to make the change active. The hostname saved in this file (/etc/hostname) will be preserved on system reboot (and will be set using the same script we used hostname.sh).
Permanent hostname change on RedHat based systems
RedHat based system use the file /etc/sysconfig/network to read the saved hostname at system boot. This is set using the init script /etc/rc.d/rc.sysinit
/etc/sysconfig/network
NETWORKING=yes
HOSTNAME="plain.domainname.com"
GATEWAY="192.168.0.1"
GATEWAYDEV="eth0"
FORWARD_IPV4="yes"
So in order to preserve your change on system reboot edit this file and enter the appropriate name using the HOSTNAME variable.
Use sysctl to change the hostname
Why would someone need a different method of doing the same thing as above? No idea, but here is anyway: use sysctl
to change the variable kernel.hostname
:
Use:
sysctl kernel.hostname
to read the current hostname, and
sysctl kernel.hostname=NEW_HOSTNAME
to change it.
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////
参考一: 修改主机名: 在Linux
系统中,默认的主机名是loalhost,如果想修改自己的主机名,可以使用命令:hostname xxx。不过如果你正在使用X
Window窗口,用这个命令修改了主机名之后就打不开xterm了。所以,彻底一点的办法是直接修改/etc/network文件:HOSTNAME=
xxx,然后重启计算机,主机名已经被修改了。
使用DHCP的系统就不能用上述方法了,因为启动network时主机名会被改成DHCP服务器提供的名称。怎么办呢?既然主机名被粗暴的修改了,那咱们也粗暴的改回来:编辑/etc/rc,在最后加上一行hostname xxx,重启系统就OK了。。
参考二:
linux下修改主机名
1./etc/sysconfig/network
内容:
NETWORKING=yes
HOSTNAME=lh //主机名(没有这行?那就添加这一行吧)
GATEWAY=192.168.1.1
2.运行命令:
#hostname lh
//lh为主机名
3./etc/hosts
内容:
# Do not remove the following line, or various programs
# that require network functionality will fail.
127.0.0.1 localhost localhost.localdomain localhost
把第二localhost写为lh,即:
127.0.0.1 lh localhost.localdomain localhost
但是步骤3不是必须的。如果这三个步骤都做了,无论是否重起,
主机名都将修改成功
发表评论
-
Linux终端复用神器-Tmux使用梳理(程序员适用)
2018-07-06 18:41 608= = = 参考: Linux终 ... -
linux下awk内置函数的使用(split/substr/length)
2018-06-14 20:02 640= = = 【转】linux下awk内置函数的使用(s ... -
awk引用外部变量
2018-06-14 19:54 1194= 对引用的文做了格式修改和字符串修正。 增加了自己的 ... -
Linux下解决高并发socket最大连接数所受的各种限制(解除IO限制)
2018-06-01 10:47 3203== = - from:Linux下解决高并发sock ... -
SSH远程会话管理工具-screen使用教程
2018-04-11 18:08 700= 朝花夕拾:screen。尤其在远程一个黑盒,不能有多 ... -
rpm命令总结-rpm常用命令-rpm安装源后怎么删除-yum安装怎么降低版本
2018-04-10 20:39 1357= = = rpm命令总结 参考:http://ma ... -
.repo文件共存与优先级,.repo文件的修改,https的repo改成http
2018-03-29 17:16 1302= .repo文件共存与优先 ... -
yum是很么?repo文件详解,epel简介,yum源的更换,repo和epel区别
2018-03-29 17:12 2448= yum是很么?repo文件详解,epel简介,yum ... -
centos_官方源、镜像源汇总
2018-03-29 16:34 1242= = 站点版 (一)、企业站 ... -
国内yum源的安装(163,阿里云,epel)
2018-03-29 16:20 931= 国内yum源的安装(163,阿里云,epel) ... -
同步文件:sersync+rsync原理及部署
2017-09-05 19:42 1225= = = 一、为什么要用rsync+sersy ... -
无人值守安装操作系统
2017-07-17 16:47 1186= 无人值守安装操作系统,对运维来说,很节约生命。 1 ... -
Linux系统下常用日志分析工具:Logcheck简介
2017-07-17 16:15 1686= = = from:http://os.51cto ... -
linux下logrotate 配置和理解
2017-07-17 16:09 960= = = 对于Linux 的系统安全来说,日志文件 ... -
centos 查看版本(转)
2016-12-23 18:58 500centos 查看版本(转) 有以下命令可以查看 ... -
wget下载https文件
2016-12-01 22:27 1624wget --no-check-certifica ... -
利用Linux命令行进行文本按行去重并按重复次数排序
2016-08-26 19:22 787利用Linux命令行进行文本按行去重并按重复次数排序 ht ... -
【Apache ZooKeeper】命令行zkCli.sh使用指南
2016-07-22 20:32 8654from:http://blog.sina.com. ... -
linux nc命令常用用法
2016-07-22 20:26 916from:http://my.oschina.net/ ... -
如何修改Linux命令提示符
2016-07-22 20:16 838无颜色常用:export $PS1="[\u@\h ...
相关推荐
This prevents creation of a GUID. Cause was: java: java: No address associated with hostname java.net.UnknownHostException: java: java: No address associated with hostname at java.net.InetAddress....
Linux操作系统的hostname是一个kernel变量,可以使用如下两种方式查看 # hostname 和 # cat /proc/sys/kernel/hostname 临时修改hostname 通过hostname命令可以设置系统的hostname # hostname newname new...
They should know how to verify the integrity of the installation media and how to troubleshoot common issues that may arise during the installation process. ### Conclusion The RHCE certification is ...
(modify the file system path of each installation to a different directory so that uploads do not overlap between installations); or, * your site runs a number of web server front-ends behind a ...
The definition of an inline function needs to be in a header file, so that the compiler has the definition available for inlining at the call sites. However, implementation code properly belongs in ....
This book covers core concepts, such as hostname resolution with DNS, that are crucial to the functioning of the modern web. You’ll delve into the fundamental network protocols, TCP and UDP. ...
Installation Instructions ... If the server was installed on another machine, you will need to change the 'HostName' property in the Connection Properties dialog to point to the relevant machine.
[] 匹配中括号里的内容[a-z][A-Z][0-9]。 ! 事件。 $ 取环境变量的值。 | 管道。把前一命令的输出作为后一命令的输入,把几个命令连接起来。 |经常跟tee连用,tee 把内容保存到文档并显示出来。 三、通用后...
当我觉得对Linux系统下修改hostname已经非常熟悉的时候,今天碰到了几个个问题,这几个问题给我好好上了一课,很多知识点,当你觉得你已经掌握的时候,其实你了解的还只是皮毛。技术活,切勿浅尝则止! 实验环境:...
This path is defined by a sequence of virtual circuit identifiers (VCIDs) assigned to each link along the way. Each node on the network is aware of the VCID and uses it to forward packets along the ...
在Linux操作系统中,主机名是标识系统在网络中的唯一名称,对于SUSE Linux Enterprise Server (SLES) 11来说,修改主机名是一个重要的系统管理任务。这个过程涉及到多个步骤,通常包括配置网络接口、更新系统文件...
Linux 常用命令(xls ...• hostname -i Lookup local ip address (equivalent to host `hostname`) • netstat -tupl List internet services on a system • netstat -tup List active connections to/from system
- **Describe the Impala Table**: Discover how to view the schema of a table. - **Query the Impala Table**: Execute complex queries and analyze the results. #### Advanced Tutorials - **Attaching an...
displays the number of new messages (as msn messenger display messages) and plays a WAV file<END><br>52 , urlhist.zip This sample demonstrates how to loop through the history folder of Internet ...
callback messages, and events, I have illustrated how it is possible to avoid blocking in an application.These controls form a custom set of TCP/IP controls I have been developing over the past year....
# configuration written to /home/wwt/linux_r16/lichee/out/sun8iw5p1/linux/common/buildroot/.config # make:离开目录“/home/wwt/linux_r16/lichee/buildroot” make:进入目录'/home/wwt/linux_r16/lichee/...
* Change the 127.0.0.1 to either the IP of your crtmpserver or simply use a hostname of your machine * Replace file-download with the actual filename of your sample you download. Remeber to omit the ....
System.out.println("Host Name: " + inetAddress.getHostName()); } ``` `isReachable()`方法可以用来检查设备是否在线,但请注意,它可能需要管理员权限才能正确工作。 5. **注意网络安全和性能**: 在实际...
RPi更改主机名简单的脚本来更改树莓派的主机名使用示例:sh change_hostname.sh [newhostname] 使用ssh user @ host'bash -s [newhostname]'<./change_hostname.sh远程运行更新ssh-config 需要运行以处理另一个...