Hello all,
I'm using MQX 4.1. I want to use www.dnsserver.com instead of an IP address . (ip is 192.168.1.202 --> 0xC0A801CA).
I define DNS parameters under source/if/dnshost.c the following way:
1. i enabled DNS
2.char DNS_Local_network_name[] = "arc.com.";
char DNS_Local_server_name[] = "DnsServer";
DNS_SLIST_STRUCT DNS_Local_server_list[] =
{{DNS_Local_server_name, 0, 0xC0A801CA, 0, 0, 0, 0,
0, DNS_A, DNS_IN }};
3.Then I call DNS_init() in my code.
actually the dns task is created but i am putting www.DnsServer.com in chrome browser but web page is not opening .it is opening
only for ip adress.
any one can guide me, any other modification or any other function has to be add.
Regards
thippeswamy
Hi swamy ,
it does not work that way DNS is feature used to identify the IP address by name , so we need to put the DNS server IP available in the network or the ISP provided IP address . in the DNS server you need have entry of the MQX device so it can identify the ip address and provide the hostname
Hi Thippeswamy J,
Please check the below thread:
I hope this helps, have a nice day!
Sol
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------
I have a problem with dns, dns did not work. I have the k60 module with MQX 3.7 operating system. The dns's introduce this:
while (DNS_init ()! = RTCS_OK)
{
_time_delay (1000);
}
strcpy (string, "google.com.");
host = gethostbyname (string);
while (host == NULL)
{
if (host! = NULL) {
name = host-> h_name;
alias1 = host-> h_aliases [0];
name2 = host-> h_aliases [1];
type = host-> h_addrtype;
length = host-> h_length;
ipDNS = * (uint_32_ptr) host-> h_addr_list [0];
}
host = gethostbyname (string);
}
When initializing the ethernet I have to call the function ipcg_add_dns?
ipcfg_init_device (DEMOCFG_DEFAULT_DEVICE, address);
_ip_address DNS_server_ipaddr;
DNS_server_ipaddr = inet_addr ("8.8.8.8");
if (ipcfg_add_dns_ip (DEMOCFG_DEFAULT_DEVICE, DNS_server_ipaddr) == TRUE)
{
printf ("DNS added ok");
} else {
printf ("DNS added NOT ok");
}
In addition to the file dnshosts.c must configure something?
thank you