ssh via putty using hostname in opensuse [closed]
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 11 years ago.
开发者_高级运维 Improve this questionI am using opensuse 11.3 and it is connected to DHCP network. I am using putty to connect top machine from window with command: putty -ssh user@ip-address (it works fine) but when trying to connect using hostname it fails to resolve: putty -ssh user@
Every time I want to connect to machine i need to check its ip first and then connect via putty, but when want to connect using hostname it fails and says not able to resolve. Is there a way around so that i can use a common hostname for Linux machine without worrying about its IP address which changes after every reboot? Thanks for reply.
Regards, Ashutosh
There are many solutions to this problem (ordered by increasing difficulty order).
Change the opensuse server interface configuration so that it takes a static address instead of relying on the DHCP server.
DHCP reserved IP address. If you also run the DHCP server, the make sure the MAC address of the opensuse adapter is always assigned the same IP address. If you're on you domestic LAN at home, then this is probably done on the Internet router. Use the http interface and navigate to the DHCP server configuration form.
In the first two cases, then you just need to update your windows host files in \windows\system32\drivers\etc\hosts to assign a name to that static address.
Configure the opensuse machine to update the DNS/WINS database upon being assigned a DHCP address.
Use a common fixed address server to synchronise a configuration file upon change of network status/address. Develop a sync client service on windows to automatically update the host file upon reception of the notification.
精彩评论