Welcome! Log In Create A New Profile

Advanced

Re: [PATCH] Resolver: added support for domain names with a trailing dot

Yichun Zhang (agentzh)
January 10, 2014 03:14PM
Hello!

On Fri, Jan 10, 2014 at 11:10 AM, Ruslan Ermilov wrote:
>
> There's no such thing as domain names with a trailing dot,
> with one exception of the root domain name.
>

Well, they are just a fully qualified domain names.

>
> So I must ask. Why do you think that resolver in nginx
> should ever support names with a trailing dot?
>

Because our customers use things like "www.google.com." and expect it
to work like in their web browsers. And Nginx's resolver just returns
"Host not found" immediately.

>
> Regarding the patch, it would make more sense to strip the
> trailing dot once on entry, in ngx_resolve_name(), not in
> ngx_resolve_name_locked() which is also called internally.
>

Thank you for the suggestion! Attached the revised patch.

Thanks!
-agentzh

# HG changeset patch
# User Yichun Zhang <agentzh@gmail.com>
# Date 1389381734 28800
# Node ID 4b50d1f299d8a69f3e3f7975132e1490352642fe
# Parent 3d10680c0399cb8d2e3b601412df0495ffaab4a5
Resolver: added support for domain names with a trailing dot.

diff -r 3d10680c0399 -r 4b50d1f299d8 src/core/ngx_resolver.c
--- a/src/core/ngx_resolver.c Wed Jan 08 11:34:59 2014 -0800
+++ b/src/core/ngx_resolver.c Fri Jan 10 11:22:14 2014 -0800
@@ -356,6 +356,10 @@

r = ctx->resolver;

+ if (ctx->name.len > 0 && ctx->name.data[ctx->name.len - 1] == '.') {
+ ctx->name.len--;
+ }
+
ngx_log_debug1(NGX_LOG_DEBUG_CORE, r->log, 0,
"resolve: \"%V\"", &ctx->name);
_______________________________________________
nginx-devel mailing list
nginx-devel@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx-devel
Subject Author Views Posted

[PATCH] Resolver: added support for domain names with a trailing dot

Yichun Zhang (agentzh) 764 January 08, 2014 03:00PM

Re: [PATCH] Resolver: added support for domain names with a trailing dot

Ruslan Ermilov 303 January 10, 2014 02:12PM

Re: [PATCH] Resolver: added support for domain names with a trailing dot

Yichun Zhang (agentzh) 273 January 10, 2014 03:14PM

Re: [PATCH] Resolver: added support for domain names with a trailing dot

Maxim Dounin 282 January 13, 2014 09:00AM

Re: [PATCH] Resolver: added support for domain names with a trailing dot

Ruslan Ermilov 328 January 14, 2014 07:32AM



Sorry, you do not have permission to post/reply in this forum.

Online Users

Guests: 99
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready