LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   4MLinux (https://www.linuxquestions.org/questions/4mlinux-115/)
-   -   DNS Client configuration (https://www.linuxquestions.org/questions/4mlinux-115/dns-client-configuration-4175693413/)

tjgonzalez 04-09-2021 03:03 PM

DNS Client configuration
 
Good afternoon.
Greetings to all the members of this forum.

How can I configure my laptop to use the DNS server provided by my DHCP server?

It seems that the operating system configuration is fixed for google DNS 8.8.8.8

OS: 4MLinux v36.0 STABLE


Thanking you very much,

ferrari 04-09-2021 04:27 PM

I'm not familiar with this distro, but in general terms the exact method depends on the network management tool your distro uses. Anyway, a quick search turned up this post.

Quoted post...
Quote:

Open the dhcpcd-gui script. You can do this in your terminal:

Code:

mcedit /usr/bin/dhcpcd-gui
Replace "nameserver 8.8.8.8" with whatever you wish to use, save changes, restart X.

tjgonzalez 04-09-2021 04:41 PM

Thanks for your prompt response.

Indeed I have previously read the "post" you mention, but I do not understand "Replace" nameserver 8.8.8.8 with whatever you wish to use ... ".
If I comment the line the OS does not configure the DNS from the DHCP server.
So, I don't know what to put in the "NAMESERVER" variable or if additional configuration is needed in the DHCPCD daemon.


Regards,

ferrari 04-09-2021 04:44 PM

Quote:

Originally Posted by tjgonzalez (Post 6239249)
Thanks for your prompt response.

Indeed I have previously read the "post" you mention, but I do not understand "Replace" nameserver 8.8.8.8 with whatever you wish to use ... ".
If I comment the line the OS does not configure the DNS from the DHCP server.
So, I don't know what to put in the "NAMESERVER" variable or if additional configuration is needed in the DHCPCD daemon.


Regards,

Is the DHCP server also your gateway router? Does it provide DNS as well? If so, replace it with the IP address of the gateway.

tjgonzalez 04-09-2021 05:05 PM

Yes, it is clear. I understand you perfectly. In fact the laptop is browsing and downloading from the internet, but with the configuration fixed to the 8.8.8.8 DNS server as it remains after installing 4MLinux.

Thank you,

zk1234 04-09-2021 05:29 PM

1. Configure your network: Menu > Settings > Networking > NetConfig

2. Execute the "connect" command in your terminal. The output on my PC is as follows:
Code:

oot@4MLinux:~$ connect
Connecting via the eth0 interface:
udhcpc: started, v1.31.1
udhcpc: sending discover
udhcpc: sending discover
udhcpc: sending discover
udhcpc: sending select for 192.168.1.26
udhcpc: lease of 192.168.1.26 obtained, lease time 86400
deleting routers
route: SIOCDELRT: No such process
adding dns 192.168.1.1

so my DNS nameserver is 192.168.1.1

3. Now you can open Menu > Settings > Networking > dhcpcd
Code:

# Enable dhcpcd daemon?
DAEMON=yes

# Nameserver to use?
NAMESERVER=8.8.8.8

# Interface to use (*)?
IFACE=any

# Enable dhcpcd GUI?
GUI=yes

# Enable notifications?
NOTIFICATIONS=no

# (*) Note:
# You can replace "any" with eth0, wlan0 and so on.

You can either disable dhcpcd daemon completely (DAEMON=no) or replace 8.8.8.8 with your DNS nameserver.

.

tjgonzalez 04-09-2021 07:12 PM

Thank you again.

Have a good day.


All times are GMT -5. The time now is 02:58 PM.