diff --git a/CHANGES.txt b/CHANGES.txt index 2a0743c9ec..a111d37592 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -30,6 +30,9 @@ Features Bugfixes -------- +* Open ``127.0.0.1`` when using ``nikola serve -b`` and default + ``0.0.0.0`` hostname to avoid resolution issues — the site is still + available on all interfaces (Issue #2755) * Don't break animated GIFs in postprocessing (Issue #2750) * More robust shortcodes, no need to escape URLs in reSt, work better with LaTeX, etc. diff --git a/nikola/plugins/command/serve.py b/nikola/plugins/command/serve.py index 5e0f55d497..91eb05750a 100644 --- a/nikola/plugins/command/serve.py +++ b/nikola/plugins/command/serve.py @@ -146,6 +146,8 @@ def _execute(self, options, args): if options['browser']: if ipv6: server_url = "http://[{0}]:{1}/".format(*sa) + elif sa[0] == '0.0.0.0': + server_url = "http://127.0.0.1:{1}/".format(*sa) else: server_url = "http://{0}:{1}/".format(*sa) self.logger.info("Opening {0} in the default web browser...".format(server_url))