Fedora Linux Support Community & Resources Center
Old 8th September 2005, 02:31 PM
philipaby Offline
Registered User
Join Date: Sep 2005
Posts: 2
linux boots slow after changing /etc/hosts

Hi everyone,
I am a realy newbie into the Linux (actually Unix) environment. I was writing a simple socket program in C where there server program was running on the same machine as the client program. My ip was and when my server socket tried to bind to the ip with the port it wasn't able to. Gave the error "cannot bind to the requested ip address". I then changed the ip in the program to and everything worked fine.

So I went ahead and added a line in the hosts file (which only had the localhost) which said testname. After this the socket program worked fine when I used the 192 ip.

That being said, when i restarted the machine, linux took a lot of time to reboot. As soon as i removed this newly added line from the hosts file, it was booting at it's normal speed.

My computer comes in through a router, I don't know if DHCP has anything to do with this.

Thanks in advance for the help. Really appreciate the fact that I can ask folks who know this stuff about this.

Kind Regards
Reply With Quote
Old 8th September 2005, 02:47 PM
mndar Offline
Registered User
Join Date: Feb 2005
Posts: 1,108
Gave the error "cannot bind to the requested ip address"
I read this somewhere. After creating a socket, set the socket options as follows
setsockopt(sockfd,SOL_SOCKET,SO_REUSEADDR,&yes,siz eof(int));
where sockfd is the socket and yes is an integer with value 1
This solved the problem for me.
Reply With Quote
Old 29th September 2005, 07:44 PM
philipaby Offline
Registered User
Join Date: Sep 2005
Posts: 2
Thanks mndar,
That solved the problem. Really appreciate the help. Sorry for being late in the reply as I was out on vacation.
Reply With Quote

boots, changing, linux, or etc or hosts, slow

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Fedora SOMETIMES boots very slow.. infernosoft Using Fedora 12 6th May 2009 09:24 PM
fedora boots so slow... Fittersman Using Fedora 4 9th October 2007 11:10 PM
installed wine, ms office, linux no longer boots jbob286 Using Fedora 6 25th January 2007 04:33 PM
Slow resolving hosts in anything HELP??? garymayor Servers & Networking 5 2nd February 2005 10:36 PM
Web browsers slow at resolving hosts in FC2 jdc EOL (End Of Life) Versions 5 20th May 2004 02:56 AM

Current GMT-time: 15:06 (Saturday, 19-08-2017)

TopSubscribe to XML RSS for all Threads in all ForumsFedoraForumDotOrg Archive

All trademarks, and forum posts in this site are property of their respective owner(s).
FedoraForum.org is privately owned and is not directly sponsored by the Fedora Project or Red Hat, Inc.

Privacy Policy | Term of Use | Posting Guidelines | Archive | Contact Us | Founding Members

Powered by vBulletin® Copyright ©2000 - 2012, vBulletin Solutions, Inc.

FedoraForum is Powered by RedHat