allug4me DeleteThis @gmail.com said:
>I am writing a small echo client in C on GNU/Linux system. The echo
>server is on Windows System. I am trying to use gethostbyname to
>resolve the Windows Hostname.
>But I am not able to do so.
>
>The name is not being resolved. I am able to use my application only
>with IP Address.
>
>Let me explain my environment:
>
>Router-----------windows(echo server)
>|
>|
>|
>Linux(echo client)
>
>
>Both windows and linux systems have obtained ip address via dhcp from
>the Router.
.... ok, and you want host names. For that, you should have DNS server
running (and actually a dynamic DNS, updated by your routers DHCP
server when it hands out addresses).
I don't think ADSL routers generally provide this kind of functionality.
What might work would be to configure your router to assign fixed
addresses for clients, and place the address-name relationships on
/etc/hosts on the Linux machine (unless you want to run a full-blown
DNS server there).
--
Wolf a.k.a. Juha Laiho Espoo, Finland
(GC 3.0) GIT d- s+: a C++ ULSH++++$ P++@ L+++ E- W+$@ N++ !K w !O !M V
PS(+) PE Y+ PGP(+) t- 5 !X R !tv b+ !DI D G e+ h---- r+++ y++++
"...cancel my subscription to the resurrection!" (Jim Morrison)