Skip to content

Adding a flag for RDNS domain #123

@Powerhamster

Description

@Powerhamster

I want to create whitelisting in our firewall for specific RDNS entries because I don't know the PrimaryIPv4 address of the machine that will be created.

Is it possible to add a flag for providing a domain that is used for the RDNS pointer?

I am a go newbie. Would something like this work?

func (d *Driver) setupRDNS() error {
	if d.RDNSDomain == "" {
		return nil
	}
	log.Infof("configuring RDNS ...")
	opts := hcloud.PrimaryIPChangeDNSPtrOpts{
		DNSPtr: d.MachineName + "." + d.RDNSDomain,
	}
	act, _, err := d.getClient().PrimaryIP.ChangeDNSPtr(context.Background(), opts)

	if err != nil {
		return fmt.Errorf("could not change DNS pointer: %w", err)
	}

	return d.waitForAction(act)
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions