We help IT Professionals succeed at work.

how to "clear" the dns entries and everything that maight be cached in a linux box (using ifconfig?)

Medium Priority
10,254 Views
Last Modified: 2012-06-27
I have suse 10.

I have some probs with a website from the localnetwork which i cannot open it with any browser, not even with lynx.

in windows boxes i used ipconfig /release  or ipconfig /flushdns to clean everything that might have been cached.
In linux i dont know how to do that with ifcongif or any other command.

Can any one help ?
Comment
Watch Question

Use Below Command

rnds flush

Then Restart the Service

/etc/rc.d/named restart

Author

Commented:
hell:/ # rnds flush
bash: rnds: command not found

and about named, i dont run any dns server like bind etc.
then do rcnetwork restart

Not the solution you were looking for? Getting a personalized solution is easy.

Ask the Experts
The Suse Linux equivalent of the Windows command ipconfig is:

"rcnscd restart"

Look at /etc/nscd.conf for more information.
>>The Suse Linux equivalent of the Windows command ipconfig is:
>>
>>"rcnscd restart"

i would say no it is /sbin/ifconfig
To mimic the functionality of the ipconfig /flushdns (To flush the DNS cache on a SUSE 10 system) use the command "rcnscd restart" from the shell of your choice.

If you want to configure a network interface use "ifconfig" configure a network interface.

In Microsoft Windows, you can use the command ipconfig /flushdns to flush the DNS resolver cache. You can also use the command ipconfig /displaydns to view the DNS resolver cache.

C:\>ipconfig /flushdns

Windows IP Configuration

Successfully flushed the DNS Resolver Cache.

How to Flush DNS in Mac OSX
In Mac OSX, you can use the command lookupd -flushcache to flush the DNS resolver cache.

bash-2.05a$ lookupd -flushcache

How to Flush DNS in Linux:

In Linux, the nscd daemon manages the DNS cache.

To flush the DNS cache, restart the nscd daemon.

There is functionality built into ipconfig on Windows that does not translate one-for-one to ifconfig in Unix/Linux.

At the end of the day: "nscd restart" is the correct answer to the question.

Artysystem administrator
Top Expert 2007
Commented:
Usually Linux doesn't cache DNS records if you dont' ask to do so with nscd daemon.
To release IPs (if you have DHCP enabled) run from root:
# dhclient -r
To get IP again:
# dhclient eth0

Author

Commented:
Thank you all.

rcnscd restart works :
hell:/ # rcnscd restart
Shutting down Name Service Cache Daemon                               done
Starting Name Service Cache Daemon                                    done

but dhclient -r (which sounds very interesting) doesnt work. :(

hell:/ # dhclient -r
bash: dhclient: command not found



rcnetwork restart

is still my favorite. have you tried?
Artysystem administrator
Top Expert 2007

Commented:
MaRiOsGR you are probably have static IPs, so forget about DHCP releases.

Author

Commented:
you're right i had disabled the dhcp :D

thank you all guys ! i fixed my problem.

Author

Commented:
rcnetwork restart also works ;)
listen to me .-)
Access more of Experts Exchange with a free account
Thanks for using Experts Exchange.

Create a free account to continue.

Limited access with a free account allows you to:

  • View three pieces of content (articles, solutions, posts, and videos)
  • Ask the experts questions (counted toward content limit)
  • Customize your dashboard and profile

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

OR

Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.