Project

General

Profile

Actions

Feature #2587

closed

Support name lookups in server.bind

Added by chauhanamit06 over 9 years ago. Updated 4 months ago.

Status:
Wontfix
Priority:
Normal
Category:
core
Target version:
-
ASK QUESTIONS IN Forums:
No

Description

In the current release the web server will not start when the user set IPv6 option in configuration file but assign IPv4 IP address.

So I enhance the code in network.c and tested it for the below scenarios:

In lighttpd.conf:
Case 1: Enable IPv6 option:

server.use-ipv6 = "enable" 
server.bind = "IPv4 address"

Output log:
2014-08-06 19:14:46: (network.c.210) You have enable IPv6 but assign Ipv4 Address. lighttpd will start on IPv4 address 107.109.224.39

Case 2: Remove IPv6 option :

#server.use-ipv6 = "enable" 
server.bind = "IPv6 address"
Output log:

2014-08-06 19:16:08: (network.c.217) You have not enable IPv6 option but assign Ipv6 Address. lighttpd will start on IPv6 address 2607:f388:202:b3ff::8328

Case 3:

server.use-ipv6 = "enable" 
server.bind = "IPv6 address"

Case 4:

#server.use-ipv6 = "enable" 
server.bind = "IPv4 address"

Kindly review my patch.


Files

network.patch (1.48 KB) network.patch Checking address family for the supplied IP Address. chauhanamit06, 2014-08-06 15:51
Actions #1

Updated by stbuehler over 9 years ago

  • Subject changed from Enhance code for IPv6/IPv4 socket to Support name lookups in server.bind
  • Status changed from New to Wontfix
  • Assignee deleted (chauhanamit06)
  • Target version deleted (1.4.36)

I don't see how your patch relates to IPv4/IPv6 - what you actually wanted is to support name lookups in server.bind as far as I can see. If I am wrong please see IPv6-Config for details on the IPv6 configuration, and tell us what exact config doesn't work the way it should, and how your patch is supposed to fix it.

I do not want to support hostnames in server.bind for similar reasons we don't support them in proxy and *cgi modules: DNS is for names that might change, and supporting such change (with timeouts and so on) is way too complex right now. (Also your patch only handles the first returned address - there could be many.)
You could always generate the config from scripts, and do DNS lookups in those scripts - that way you have full control and are aware of the drawbacks.

Actions #2

Updated by gstrauss 4 months ago

  • ASK QUESTIONS IN Forums set to No

lighttpd 1.4.46 and later support a limited DNS lookup, taking only the first address returned by the DNS resolver. Note: the name is then never looked up again, so if the IP changes in DNS, lighttpd will not discover the change until the next time lighttpd is restarted.

Actions

Also available in: Atom