Solaris / OpenSolarisThis forum is for the discussion of Solaris, OpenSolaris, OpenIndiana, and illumos.
General Sun, SunOS and Sparc related questions also go here. Any Solaris fork or distribution is welcome.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Hi,
I am using OpenSolaris, I have configured my system with DHCP.
My problem is the /etc/hosts in not getting updated whenever the new IP has been assigned.I have to make an entry every time in the /etc/hosts whenever a new IP is assigned. Actually I am doing a project on Network Monitoring System, In which I retrieve the host name and the Host Address to monitor it.
This is my /etc/hosts entry
127.0.0.1 loghost solaris
172.1.3.90 loghost solaris
In which i have entered 172.1.3.90. And I have to change ts entry every time a new IP is assigned to my Network Interface. I query the Host address in my program as
String Hostname = InetAddress.getLocalHost().getHostAddress();
System.out.println("The Hostname is :"+Hostname);
This always prints "172.1.3.90", even though the IP is changed.
As per my understanding, the /etc/hosts should be updated dynamically with DHCP, but its not happening.
Hi,
I am using OpenSolaris, I have configured my system with DHCP.
My problem is the /etc/hosts in not getting updated whenever the new IP has been assigned.I have to make an entry every time in the /etc/hosts whenever a new IP is assigned. Actually I am doing a project on Network Monitoring System, In which I retrieve the host name and the Host Address to monitor it.
This is my /etc/hosts entry
127.0.0.1 loghost solaris
172.1.3.90 loghost solaris
In which i have entered 172.1.3.90. And I have to change ts entry every time a new IP is assigned to my Network Interface. I query the Host address in my program as
String Hostname = InetAddress.getLocalHost().getHostAddress();
System.out.println("The Hostname is :"+Hostname);
This always prints "172.1.3.90", even though the IP is changed.
As per my understanding, the /etc/hosts should be updated dynamically with DHCP, but its not happening.
Please help me in resolving this problem.
Thanks
-Chandan
To my knowledge, the /etc/hosts file won't change with a DHCP change. When the system is booted, it'll request a new address, and configure the interface accordingly. Depending on the search order, you'll either look at DNS or hosts first. If you do a query, and it succeeds with a host file lookup, it stops there, because it found what it needed.
Distribution: Solaris 11.4, Oracle Linux, Mint, Debian/WSL
Posts: 9,789
Rep:
Your /etc/hosts is bogus. 127.0.0.1 should have localhost as primary name, only one loghost alias should be there and solaris should resolve in a single IP address.
I guess nwam might update your /etc/hosts file but your dhcp server should provide a hostname along with the IP address for this to work (if nwam does it really).
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.