def METHOD_NAME(config_dir: str, settings_yaml: str):
    """
    Manipulate the main Cobbler configuration file which is in YAML format. This function backs the original
    configuration up and writes a new one with the required changes to the disk.
    :param config_dir: The directory of Cobbler where the config files are.
    :param settings_yaml: The name of the main YAML file of Cobbler.
    """
    full_path = os.path.join(config_dir, settings_yaml)
    backup_file(full_path)
    with open(full_path) as settings_file:
        filecontent = yaml.safe_load(settings_file.read())
    filecontent["server"] = socket.getfqdn()
    # In case of failing DNS resolution, we get a OSError (socket.gaierror)
    try:
        filecontent["next_server_v4"] = socket.getaddrinfo(filecontent["server"], None, socket.AF_INET)[1][4][0]
    except OSError:
        filecontent["next_server_v4"] = ""
    try:
        filecontent["next_server_v6"] = socket.getaddrinfo(filecontent["server"], None, socket.AF_INET6)[1][4][0]
    except OSError:
        filecontent["next_server_v6"] = ""
    if not filecontent["next_server_v4"] and not filecontent["next_server_v6"]:
        print("ERROR: Neither IPv4 nor IPv6 addresses can be resolved for configured FQDN: {}. Please check your DNS and hostname configuration.".format(filecontent["server"]))
        exit(1)
    filecontent["pxe_just_once"] = True
    filecontent["redhat_management_server"] = socket.getfqdn()
    yaml_dump = yaml.safe_dump(filecontent)
    with open(full_path, "w") as settings_file:
        settings_file.write(yaml_dump)