Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I use RedHat machine. /etc/resolve.conf was set to nameserver and it works well.

I'm wondering how to connect my machine if it's disconnected from internet? It seems that if DNS of is not available, I can't login. Am I right? How to set it up if I want to login anyway?

This redHat is a virtual machine, resides on my laptop. I want to be able to login even-though the laptop is not connected to internet. Thank you!

share|improve this question

migrated from serverfault.com Aug 7 '12 at 14:43

This question came from our site for system and network administrators.

Firstly this should have gone to superuser.com not us (read our FAQ) and secondly how is your login process reliant on full web dns access? Either you have some form of LDAP setup that needs external access (in which case it won't work disconnected) or it doesn't. – Chopper3 Aug 7 '12 at 14:19
It doesn't login at all, or it take an excessive amount of time? – Chris S Aug 7 '12 at 14:42
You are probably not right. What is "can`t login"? What is the error message? What happens, what does not happen, how do you log in? – Nils Aug 7 '12 at 20:11
Do you mean login in a console or via ssh, or both? – jachguate Aug 8 '12 at 6:17

If you are logging in using ssh, when you try to connect it will perform a reverse DNS lookup on your IP. This is for security (supposedly), as often Hax0rs will use a spoof DNS record when trying to connect to random ssh services. In centos this doesn't actually stop you connecting, but it does delay the login process by about 40 seconds.

In my experience with CentOS, if this check fails it will not prevent login, however it will create a log entry saying there is a possible hacking attempt. If you are using a script with expect, it may fail unless you declare a wait time.

To get around this you can add UseDNS no to /etc/ssh/sshd.conf and reload your sshd service. This should stop reverse lookups.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.