- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- /etc/hosts need to be in correct format in multipl...
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Discussions
Discussions
Forums
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-20-2010 10:36 PM
тАО07-20-2010 10:36 PM
/etc/hosts need to be in correct format in multiple hosts.
I have an issue that i need to correct /etc/hosts file on around 800 servers.
what I want to do is I am mentioning as follows :
Current entry in /etc/hosts file is below:
Ip_address hostname FQDN
and some servers have entry as below
Ip_address hostname
I want to make it as below on all the server
Ip_address FQDN hostname
I have one jump server from where I am able to ldo ssh on all the servers without giving any passsword.
Please help....
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-20-2010 10:39 PM
тАО07-20-2010 10:39 PM
Re: /etc/hosts need to be in correct format in multiple hosts.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-20-2010 10:53 PM
тАО07-20-2010 10:53 PM
Re: /etc/hosts need to be in correct format in multiple hosts.
Ideally you would first copy the script to each machine. Then you could invoke ssh to fix each machine.
You could write an awk script to read each line of /etc/hosts and if there are only two fields and the first isn't "#", then you can invoke:
nslookup Ip_address | grep "Name:"
and get the second field as the FQDN.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-21-2010 05:00 PM
тАО07-21-2010 05:00 PM
Re: /etc/hosts need to be in correct format in multiple hosts.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-21-2010 06:41 PM
тАО07-21-2010 06:41 PM
Re: /etc/hosts need to be in correct format in multiple hosts.
Its better if you use DNS anways even if you put the entries as
IP FQDN Hostname rather than
IP Hostname FQDN
Its same right there is not issue with this.
And if you want to use DNS check nsswitch.conf file and change the
hosts: line
thats would be feasible I suppoe.
BR,
Kapil+