You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@trafficserver.apache.org by Masaori Koshiba <mk...@yahoo-corp.jp> on 2015/01/07 05:05:06 UTC

A question on expanding unqualified hostnames with local domain

Hello,

I got a problem with resolving unqualified hostnames by expanding to the local domain.
It looks like ATS splits the local domain in 2 domains.
Is there any settings to restrain ATS splitting the local domain?

# Details

Although my local domain is 'yahoo.co.jp', ATS expands the domain 'aaa' to 'aaa.co.jp' when I send a proxy request like following,

----
curl -x localhost:8080 http://aaa/
----

As far as I understand, the behavior of ATS is below.

1. When ATS start, ATS load the local domain from resolv.conf and add 'yahoo.co.jp' and 'co.jp' to domain list.
2. ATS recives the request.
3. ATS adds '.yahoo.co.jp' to the domain and queries 'aaa.yahoo.co.jp'. This query fails because there no such domain.
4. ATS adds '.co.jp' to the domain and queries 'aaa.co.jp'.

I just want ATS to add only '.yahoo.co.jp', my local domain, and return "502 Cannot find server".

# My Settings

My settings are below. If you need more details, please tell me.

## records.config
----
CONFIG proxy.config.http.server_ports STRING 8080
CONFIG proxy.config.url_remap.remap_required INT 0
CONFIG proxy.config.dns.search_default_domains INT 1
CONFIG proxy.config.dns.resolv_conf STRING /etc/resolv.conf
----

## /etc/resolv.conf
----
domain          yahoo.co.jp
----

Thanks,
Masaori

Re: A question on expanding unqualified hostnames with local domain

Posted by Yongming Zhao <mi...@gmail.com>.
I think by design, if proxy.config.dns.search_default_domains is set to “1”, it will put the default domain into the search list, which will a merged with the search domains.
the man page on resolve.conf show that the search domain will be set to default domain by default, hehe.

I thinks that most of the domain & search functions will be used in the forward proxy use case, where mostly a mix of internet and intranet. if someone is running on this dependence, I would like to hear how is your concern.

thanks


- Yongming Zhao 赵永明

> 在 2015年1月8日,下午5:24,Masaori Koshiba <mk...@yahoo-corp.jp> 写道:
> 
> Filed as TS-3281. I'll send a patch later.
> 
> Actually, I don't intend ATS to do the domain name expanding. I found the behavior by chance.
> 
> 2015/01/08 16:51、Yongming Zhao <mi...@gmail.com> のメール:
> 
>> well, looks like a bug for me. the domain & search in resolv.conf is very complex handled in the dns resolver codes, and worse when deal with splitdns.
>> 
>> please file a Jira on this issue, as aways, patch is welcome.
>> 
>> btw, why would you want ATS to do the domain name expanding for you? I think most of our modern clients will try to make the expanding on UA side, right? I had think of removing the domain and search functions from the resolver codes, haha
>> 
>> 
>> - Yongming Zhao 赵永明
>> 
>>> 在 2015年1月7日,下午12:05,Masaori Koshiba <mk...@yahoo-corp.jp> 写道:
>>> 
>>> Hello,
>>> 
>>> I got a problem with resolving unqualified hostnames by expanding to the local domain.
>>> It looks like ATS splits the local domain in 2 domains.
>>> Is there any settings to restrain ATS splitting the local domain?
>>> 
>>> # Details
>>> 
>>> Although my local domain is 'yahoo.co.jp', ATS expands the domain 'aaa' to 'aaa.co.jp' when I send a proxy request like following,
>>> 
>>> ----
>>> curl -x localhost:8080 http://aaa/
>>> ----
>>> 
>>> As far as I understand, the behavior of ATS is below.
>>> 
>>> 1. When ATS start, ATS load the local domain from resolv.conf and add 'yahoo.co.jp' and 'co.jp' to domain list.
>>> 2. ATS recives the request.
>>> 3. ATS adds '.yahoo.co.jp' to the domain and queries 'aaa.yahoo.co.jp'. This query fails because there no such domain.
>>> 4. ATS adds '.co.jp' to the domain and queries 'aaa.co.jp'.
>>> 
>>> I just want ATS to add only '.yahoo.co.jp', my local domain, and return "502 Cannot find server".
>>> 
>>> # My Settings
>>> 
>>> My settings are below. If you need more details, please tell me.
>>> 
>>> ## records.config
>>> ----
>>> CONFIG proxy.config.http.server_ports STRING 8080
>>> CONFIG proxy.config.url_remap.remap_required INT 0
>>> CONFIG proxy.config.dns.search_default_domains INT 1
>>> CONFIG proxy.config.dns.resolv_conf STRING /etc/resolv.conf
>>> ----
>>> 
>>> ## /etc/resolv.conf
>>> ----
>>> domain          yahoo.co.jp
>>> ----
>>> 
>>> Thanks,
>>> Masaori
>> 
> 


Re: A question on expanding unqualified hostnames with local domain

Posted by Masaori Koshiba <mk...@yahoo-corp.jp>.
Filed as TS-3281. I'll send a patch later.

Actually, I don't intend ATS to do the domain name expanding. I found the behavior by chance.

2015/01/08 16:51、Yongming Zhao <mi...@gmail.com> のメール:

> well, looks like a bug for me. the domain & search in resolv.conf is very complex handled in the dns resolver codes, and worse when deal with splitdns.
> 
> please file a Jira on this issue, as aways, patch is welcome.
> 
> btw, why would you want ATS to do the domain name expanding for you? I think most of our modern clients will try to make the expanding on UA side, right? I had think of removing the domain and search functions from the resolver codes, haha
> 
> 
> - Yongming Zhao 赵永明
> 
>> 在 2015年1月7日,下午12:05,Masaori Koshiba <mk...@yahoo-corp.jp> 写道:
>> 
>> Hello,
>> 
>> I got a problem with resolving unqualified hostnames by expanding to the local domain.
>> It looks like ATS splits the local domain in 2 domains.
>> Is there any settings to restrain ATS splitting the local domain?
>> 
>> # Details
>> 
>> Although my local domain is 'yahoo.co.jp', ATS expands the domain 'aaa' to 'aaa.co.jp' when I send a proxy request like following,
>> 
>> ----
>> curl -x localhost:8080 http://aaa/
>> ----
>> 
>> As far as I understand, the behavior of ATS is below.
>> 
>> 1. When ATS start, ATS load the local domain from resolv.conf and add 'yahoo.co.jp' and 'co.jp' to domain list.
>> 2. ATS recives the request.
>> 3. ATS adds '.yahoo.co.jp' to the domain and queries 'aaa.yahoo.co.jp'. This query fails because there no such domain.
>> 4. ATS adds '.co.jp' to the domain and queries 'aaa.co.jp'.
>> 
>> I just want ATS to add only '.yahoo.co.jp', my local domain, and return "502 Cannot find server".
>> 
>> # My Settings
>> 
>> My settings are below. If you need more details, please tell me.
>> 
>> ## records.config
>> ----
>> CONFIG proxy.config.http.server_ports STRING 8080
>> CONFIG proxy.config.url_remap.remap_required INT 0
>> CONFIG proxy.config.dns.search_default_domains INT 1
>> CONFIG proxy.config.dns.resolv_conf STRING /etc/resolv.conf
>> ----
>> 
>> ## /etc/resolv.conf
>> ----
>> domain          yahoo.co.jp
>> ----
>> 
>> Thanks,
>> Masaori
> 


RE: A question on expanding unqualified hostnames with local domain

Posted by Luca Rea <lu...@contactlab.com>.
Hi,
that's not a bug but a feature of the "domain" option of some resolvers (depending on release).
Do you want fire a jira to change the behavior of your OS resolver?? Try updating it.

Re: A question on expanding unqualified hostnames with local domain

Posted by Yongming Zhao <mi...@gmail.com>.
well, looks like a bug for me. the domain & search in resolv.conf is very complex handled in the dns resolver codes, and worse when deal with splitdns.

please file a Jira on this issue, as aways, patch is welcome.

btw, why would you want ATS to do the domain name expanding for you? I think most of our modern clients will try to make the expanding on UA side, right? I had think of removing the domain and search functions from the resolver codes, haha


- Yongming Zhao 赵永明

> 在 2015年1月7日,下午12:05,Masaori Koshiba <mk...@yahoo-corp.jp> 写道:
> 
> Hello,
> 
> I got a problem with resolving unqualified hostnames by expanding to the local domain.
> It looks like ATS splits the local domain in 2 domains.
> Is there any settings to restrain ATS splitting the local domain?
> 
> # Details
> 
> Although my local domain is 'yahoo.co.jp', ATS expands the domain 'aaa' to 'aaa.co.jp' when I send a proxy request like following,
> 
> ----
> curl -x localhost:8080 http://aaa/
> ----
> 
> As far as I understand, the behavior of ATS is below.
> 
> 1. When ATS start, ATS load the local domain from resolv.conf and add 'yahoo.co.jp' and 'co.jp' to domain list.
> 2. ATS recives the request.
> 3. ATS adds '.yahoo.co.jp' to the domain and queries 'aaa.yahoo.co.jp'. This query fails because there no such domain.
> 4. ATS adds '.co.jp' to the domain and queries 'aaa.co.jp'.
> 
> I just want ATS to add only '.yahoo.co.jp', my local domain, and return "502 Cannot find server".
> 
> # My Settings
> 
> My settings are below. If you need more details, please tell me.
> 
> ## records.config
> ----
> CONFIG proxy.config.http.server_ports STRING 8080
> CONFIG proxy.config.url_remap.remap_required INT 0
> CONFIG proxy.config.dns.search_default_domains INT 1
> CONFIG proxy.config.dns.resolv_conf STRING /etc/resolv.conf
> ----
> 
> ## /etc/resolv.conf
> ----
> domain          yahoo.co.jp
> ----
> 
> Thanks,
> Masaori


Re: A question on expanding unqualified hostnames with local domain

Posted by Masaori Koshiba <mk...@yahoo-corp.jp>.
Hi, Luca

It works. Thanks!

BTW, I found a compile option to restrain ATS splitting the local domain name, called "RFC1535" in old old commit log.

https://github.com/apache/trafficserver/commit/6afbdc54f41fce16e352eefb438ea2ebcc2ed149#diff-c111eacec46303aaa8cf4796bf8140cdL879

This option is removed by the commit of TS-129. But I couldn't find the reasons why this option is removed in the ticket.
Does any body know?

2015/01/07 21:52、Luca Rea <lu...@contactlab.com> のメール:

> Hi,
> what if you use the "search" option instead of "domain"? 


RE: A question on expanding unqualified hostnames with local domain

Posted by Luca Rea <lu...@contactlab.com>.
Hi,
what if you use the "search" option instead of "domain"? 

Re: A question on expanding unqualified hostnames with local domain

Posted by Masaori Koshiba <mk...@yahoo-corp.jp>.
Hi, Luca

Thanks for reply. Yes I tried. With "CONFIG proxy.config.dns.search_default_domains INT 0", ATS dosen't expand unqualified hostnames.
This is not useful for me. What I need is expanding hostnames with only local domain.

Thanks,
Masaori

2015/01/07 18:00、Luca Rea <lu...@contactlab.com> のメール:

> Hi,
> did you try "CONFIG proxy.config.dns.search_default_domains INT 0" ?


RE: A question on expanding unqualified hostnames with local domain

Posted by Luca Rea <lu...@contactlab.com>.
Hi,
did you try "CONFIG proxy.config.dns.search_default_domains INT 0" ?