"gem install rails" fails with DNS error "gem install rails" fails with DNS error ruby ruby

"gem install rails" fails with DNS error


Like blasio pointed out. It seems like the Xfinity modems are setting up the search domain to home.network and this is messing things up for the reasons he mentioned (essentially, home.network is now a valid domain name that the modems are trying to contact before making a connection).

I had the same problem and the modification on resolv.conf seem to do the trick, and that should probably be an accepted solution for linux environments. I had this problem while attempting this on a virtual machine running ubuntu, and my host(OSX Mavericks) was passing down the search home.network like the modem is, so I wanted to see if I could find a solution that could be done at the host OS level because the same problem happened when I attempted gem install rails on my OSX terminal.

If you go to the OSX network settings, under DNS you'll see the home.network line under the Search Domains area. After some googling it seems that comcast recently changed this from http://hds1.ma.comcast.net'. I changed it back, restarted and gave gem install rails another shot, which worked with no problem.

Strange issue but this is a better solution that swapping modems or changing gem sources.


I had the same issue with Comcast xFinity and Compass.

Update for Windows 7 users:

Go to Control Panel > Network and Sharing CenterUnder "Active Networks" select "Connections: Local Area Connections"In the "Local Area Connection Status" dialogue box, click on "Properties"Double click the IPv4 itemIn the "Internet Proptocol Verion 4" icon or click the "Properties" button, then click "Advanced"In the DNS tab, just above the 2nd input box, click the "Append These DNS suffixes (in order)" radio button,    then click "Add", enter "home.lan", then click OK until the dialogue closes.    Many thanks to John Smith for the Vista fix and Somnambulent for Win 8.1 fix.


Your DNS error seems to be related to .network becoming a TLD and your resolv.conf missing the ndots configuration. I just run into this issue with .prod.

Unless you have your own DNS server at home for internal .network domain, removing the search home.network from /etc/resolv.conf should fix the issue.

Since your /etc/resolv.conf is generated by resolveconf as it says in your resolv.conf, you might want to remove the home.network from your configuration, see here for example