Reduce DNS lookup by changing DB_Host to 127.0.0.1 in Wordpress config

If you're running Wordpress on an IIS server then there are some great DNS performance gains to be had by changing the DB_Host value in your WP-Config file.

WARNING - All changes of this nature should be carried out on a test site first.

Providing that you have a standard Wordpress installation, with your MySQL database running on the same server, then making this change should not cause any problems.

The DNS lookup performance benefits are huge. Having tested sites using Pingdom and Google Page Speed insights, the DNS lookup time reduces from approximately 300ms to between 0 and 5ms! 

By default the WP-config file uses 'localhost' for the DB_HOST value. With IIS the server has to resolve localhost everytime a page is requested. On a default install your localhost IP address will be 127.0.0.1

Therefore by changing define( 'DB_HOST', 'localhost' ); to define( 'DB_HOST', '127.0.0.1' ); IIS does not need to perform a DNS lookup.

 

2 Comments > Tags: IIS | Tips | Wordpress

2 responses so far ↓
  • 1 trucos clash of clans // Nov 14, 2015 at 4:42 AM

    Después de completar el proceso en el lugar, abrir el juego en su teléfono para veer los recursos actualizados.

  • 2 Crafiles // Dec 18, 2017 at 3:53 PM

    i used WP ROCKET helps me a lot

Leave a Comment

Please note URLs are not accepted in comments...

Leave this field empty:

Spread us around!

If you found anything you've read on our blog interesting/useful/funny please share it with your followers...