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

DNS entries not getting updated using confignetwork script #7407

Open
abhishek-sa1 opened this issue Sep 6, 2023 · 2 comments
Open

DNS entries not getting updated using confignetwork script #7407

abhishek-sa1 opened this issue Sep 6, 2023 · 2 comments

Comments

@abhishek-sa1
Copy link

abhishek-sa1 commented Sep 6, 2023

I am using confignetwork script to convert DHCP IP to static after provisioning of the server. I have observed that confignetwork script is not configuring DNS entries provided in the nameservers field of site table.

       str_lease_file=`ls /var/lib/dhclient/*$str_inst_nic* | grep lease`
        if [ -e "$str_lease_file" ];then
            str_inst_ip=`grep fixed-address $str_lease_file | tail -n 1 | awk '{print $2}' | sed 's/;$//'`
            str_inst_mask=`grep subnet-mask $str_lease_file | tail -n 1 | awk '{print $3}' | sed 's/;$//'`
            str_inst_gateway=`grep routers $str_lease_file | tail -n 1 | awk '{print $3}' | sed 's/;$//'`
            str_inst_dns=`grep domain-name-servers $str_lease_file | tail -n 1 | awk '{print $3}' | sed 's/;$//'`

      if [ -n "${str_inst_dns}" ];then
	        if [ $networkmanager_active -eq 1 ]; then
		        nmcli con modify $con_name ipv4.dns ${str_inst_dns}
                fi
        fi

I saw above code in configeth script(called internally from confignetwork) related to DNS. I don't find any files in /var/lib/dhclient/ folder.

Why xCAT is not picking DNS entries from nameservers field? I can see NAMESERVERS environment variable present on each server.

@samveen @gurevichmark

@abhishek-sa1
Copy link
Author

@samveen can you help me on this?

@samveen
Copy link
Member

samveen commented Sep 7, 2023

@abhishek-sa1 when you refer to nameservers, are you referring to network.nameservers of network objects? This field is used to configure the DHCP server (as with each network object). This is utilized by the confignetwork script where it examines the lease file for the domain-name-servers field, which is would have received via DHCP response when it got it's IP address.

I can see the script tries to attach that IP into the current network connection's DNS server using the nmcli con modify command.

For this node, can you check the location of the interface's lease file? Once that is traced, we can proceed from there.

Also check linkedin for a connect request from me.

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