Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Apache and DNS on IPv6-only systems got issues #980

Open
iliajie opened this issue Dec 9, 2024 · 10 comments
Open

Apache and DNS on IPv6-only systems got issues #980

iliajie opened this issue Dec 9, 2024 · 10 comments

Comments

@iliajie
Copy link
Collaborator

iliajie commented Dec 9, 2024

Hello Jamie!

Since this PR has been merged, I’d like to create a ticket to keep track of other issues that still haven’t been addressed.

In short, Apache records on IPv6-only systems are still being created as:

<VirtualHost :80 [fdb2:2c26:f4e4:0:21c:2222:1111:0000]:80>

And DNS zone records are being created as:

domain.tld.      IN      A       fdb2:2c26:f4e4:0:21c:2222:1111:0000
@jcameron
Copy link
Collaborator

jcameron commented Dec 9, 2024

Wow that DNS record seems wrong! How did you trigger this behavior exactly? Is it now possible to create an IPv6-only domain from the CLI that has this problem?

@iliajie
Copy link
Collaborator Author

iliajie commented Dec 9, 2024

Previously, it wasn’t even possible to create a new virtual server on IPv6-only system. Now, after the previous PR was merged, it is possible. However, despite running the config check and the removal of cached IPv4 record from Virtualmin config, i.e.:

image

Using the "Create Virtual Server" page still generates broken records for Apache and BIND on all IPv6-only systems:

image

Creates broken Apache and BIND configs, e.g.:

image image

As you can see, the public IPv6 address isn’t being used correctly. Interestingly, DNS A records receive the public IPv6 address, while AAAA records get the local IPv6 address. Apache doesn’t get anything for IPv4 and just prints the port, like :80.

@jcameron
Copy link
Collaborator

jcameron commented Dec 9, 2024

Ok that Apache config is definitely a bug! This should fix it though : f2b9e30

@jcameron
Copy link
Collaborator

jcameron commented Dec 9, 2024

As for the DNS issue, what does the dns_ip= line in the domain's config file under /etc/webmin/virtual-server/domains contain?

@iliajie
Copy link
Collaborator Author

iliajie commented Dec 10, 2024

Ok that Apache config is definitely a bug! This should fix it though : f2b9e30

Giving it a quick look, it seems to resolve the issue. Do we need a similar patch for Nginx?

As for the DNS issue, what does the dns_ip= line in the domain's config file under /etc/webmin/virtual-server/domains contain?

Check this out but note that 173376457750228 is the new domain, created after the system was switched to IPv6-only network.

image

@jcameron
Copy link
Collaborator

Ok that's the problem, if dns_ip is set to an IPv6 address it will cause this kind of problem. It should be empty.

@iliajie
Copy link
Collaborator Author

iliajie commented Dec 10, 2024

Oh, geez, there’s a lot of dependency on this dns_ip key! For starters, we could tweak get_dns_ip sub when it’s in automatic mode (i.e., *) and say:

local $rv = &get_external_ip_address(undef, 4);

instead of:

local $rv = &get_any_external_ip_address();

Though, the following statement $rv || &error($text{'newdynip_eext'}); should be removed.

However, even then, the DNS zone is still created incorrectly, e.g.:

image

@jcameron
Copy link
Collaborator

Yes there will be a LOT of work to make IPv6-only mode work! But for starters, the ip field should certainly not be set, and likely dns_ip will not be set unless there is an odd case where the system only has a v6 address but is behind some kind of NAT that gives it an external v4 address.

@iliajie
Copy link
Collaborator Author

iliajie commented Dec 11, 2024

Well, okay! With all the recent changes checked into master, $ip shouldn’t be set anymore already. However, as you can see in the screenshot above, dns_ip, even if empty, is still being added to DNS.

Let’s leave it for now—can you add this to your distant to-do list?

By the way, SSL certificate sharing also isn’t working correctly in IPv6-only mode...

@jcameron
Copy link
Collaborator

Sure, I will update this ticket with progress on IPv6-only support

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants