Hello all,
I'm running MQX 4.1 on a custom board based on TWR-K60F120M.
I want to get the default gateway IP of my system after setting up the network using DHCP. I will use this address
as the DNS server.
is that ok or is it a better way to do so?
Best regards,
Óscar.
Solved! Go to Solution.
Generally the DHCP server will give you a DNS server address (in addition to your own address, the netmask and the default gateway address), so you don't have to do anything.
The list of things that the DCHP server gives you is flexible and is generally configurable on the server, but DNS server address is almost always included in the list.
Hi,
Garabo, many thanks for this link is really interesting.
Matthew, you are right I tried and DNS service is working fine after DNS.
My problem now is that when I use static IP configuration DNS is not working.
How can I change the DNS server address at runtime?
Best regards,
Óscar.
Hi,
This is answered on the link Garabo posted, the solution is ipcfg_add_dns_ip().
I'm going to use it.
Best regards,
Óscar.
Generally the DHCP server will give you a DNS server address (in addition to your own address, the netmask and the default gateway address), so you don't have to do anything.
The list of things that the DCHP server gives you is flexible and is generally configurable on the server, but DNS server address is almost always included in the list.
Hi Oscar,
Take a look to this thread: Re: How to read active ethernet configuration in MQX 3.8?
Regards,
Garabo
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------