barangokalp there is not an "API" for this my friend. Its Nameservers configurations on your TLD (domain name) under your registrar, after that, you need to "glue" the configurations on your hosts config file on your server to match your records, what is happening to you is the fact that you dont have an A record. Login in your domain provider, go to DNS configurations and then add an A Record and place your server IP.