I need to check the connectivity of a host over a local network using C program, I do not wish to use system commands such as ping.
To check my ethernet I used gethostbyname() which depends on DNS server to resolving IP as per my knowledge.
I am building a simple c program to check my ethernet functionality where the connection is pair to pair and I have assigned the IP statically on both the devices. Is there any C library such as netdb.h available, which I can use to validate simple ethernet functionality.

  • Why bother with DNS? Why not just ping? – Mawg Feb 14 at 15:22
  • I do not wish to use system default commands(customized rootfs-commands removed), rather I would like to create a custom application similar to ping. – Abhinandan Tantri Feb 15 at 9:11
  • Life is too short to go reinveting the wheel. Don't you have other stuff to do? Reuse as much as you can, up to 90% of your app, if you can, and concentrate on the stuff which is new & unique to your app. – Mawg Feb 16 at 16:23

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Browse other questions tagged or ask your own question.