Skip to main content
Redhat Developers  Logo
  • AI

    Get started with AI

    • Red Hat AI
      Accelerate the development and deployment of enterprise AI solutions.
    • AI learning hub
      Explore learning materials and tools, organized by task.
    • AI interactive demos
      Click through scenarios with Red Hat AI, including training LLMs and more.
    • AI/ML learning paths
      Expand your OpenShift AI knowledge using these learning resources.
    • AI quickstarts
      Focused AI use cases designed for fast deployment on Red Hat AI platforms.
    • No-cost AI training
      Foundational Red Hat AI training.

    Featured resources

    • OpenShift AI learning
    • Open source AI for developers
    • AI product application development
    • Open source-powered AI/ML for hybrid cloud
    • AI and Node.js cheat sheet

    Red Hat AI Factory with NVIDIA

    • Red Hat AI Factory with NVIDIA is a co-engineered, enterprise-grade AI solution for building, deploying, and managing AI at scale across hybrid cloud environments.
    • Explore the solution
  • Learn

    Self-guided

    • Documentation
      Find answers, get step-by-step guidance, and learn how to use Red Hat products.
    • Learning paths
      Explore curated walkthroughs for common development tasks.
    • Guided learning
      Receive custom learning paths powered by our AI assistant.
    • See all learning

    Hands-on

    • Developer Sandbox
      Spin up Red Hat's products and technologies without setup or configuration.
    • Interactive labs
      Learn by doing in these hands-on, browser-based experiences.
    • Interactive demos
      Click through product features in these guided tours.

    Browse by topic

    • AI/ML
    • Automation
    • Java
    • Kubernetes
    • Linux
    • See all topics

    Training & certifications

    • Courses and exams
    • Certifications
    • Skills assessments
    • Red Hat Academy
    • Learning subscription
    • Explore training
  • Build

    Get started

    • Red Hat build of Podman Desktop
      A downloadable, local development hub to experiment with our products and builds.
    • Developer Sandbox
      Spin up Red Hat's products and technologies without setup or configuration.

    Download products

    • Access product downloads to start building and testing right away.
    • Red Hat Enterprise Linux
    • Red Hat AI
    • Red Hat OpenShift
    • Red Hat Ansible Automation Platform
    • See all products

    Featured

    • Red Hat build of OpenJDK
    • Red Hat JBoss Enterprise Application Platform
    • Red Hat OpenShift Dev Spaces
    • Red Hat Developer Toolset

    References

    • E-books
    • Documentation
    • Cheat sheets
    • Architecture center
  • Community

    Get involved

    • Events
    • Live AI events
    • Red Hat Summit
    • Red Hat Accelerators
    • Community discussions

    Follow along

    • Articles & blogs
    • Developer newsletter
    • Videos
    • Github

    Get help

    • Customer service
    • Customer support
    • Regional contacts
    • Find a partner

    Join the Red Hat Developer program

    • Download Red Hat products and project builds, access support documentation, learning content, and more.
    • Explore the benefits

Use Vagrant Landrush to add DNS features to your OpenShift CDK Machine

May 27, 2016
Ricardo Martinelli
Related topics:
ContainersKubernetes
Related products:
Red Hat OpenShift Container Platform

    With the release of the Red Hat Container Development Kit (CDK), it’s been easier to set up a development environment with OpenShift to create, develop and test your own containerized applications, and easier evaluate different CI/CD strategies with Jenkins --- strategies that reflect your team's unique culture.

    However, when you want to access applications by their DNS names, you cannot do so because there is no DNS server pointing to that name. That is, of course, until now!

    Vagrant provides a very nice plugin that can use dnsmasq to create a DNS caching server to provide this access.

    Vagrant Landrush plugin

    The Vagrant Landrush plugin is used to create a small DNS server to redirect traffic to your server. DNS entries are automatically updated as the VMs are created and destroyed by Vagrant.

    This plugin is available in https://github.com/vagrant-landrush/landrush.

    Installing Vagrant Landrush plugin

    Vagrant landrush can be installed with the following command:

    vagrant plugin install landrush

    After that, you can run landrush direclty from vagrant command. To check if landrush is running, you can type the following command:

    vagrant landrush status

    If landrush service is not started just run:

    vagrant landrush start

    And now landrush is running!

    $ vagrant landrush status
    Daemon status: running pid=6841

    Since landrush acts like a DNS server, you can see the DNS records stored in landrush with the following command:

    $ vagrant landrush ls
    2.2.1.10.in-addr.arpa          openshift.cdk.vm
    1.42.17.172.in-addr.arpa       openshift.cdk.vm
    openshift.cdk.vm               10.1.2.2

    Also, you can add the records with the following command:

    vagrant landrush set <fqdn> <ip-address>

    And now you have Vagrant Landrush up and running. Now we need to configure dnsmasq to query for Vagrant Landrush records. You must run the following commands to configure dnsmasq:

    sudo sh -c 'echo "server=/cdk.vm/127.0.0.1#10053" > /etc/dnsmasq.d/vagrant-landrush'

    And dnsmasq will forward all DNS queries related to cdk.vm to Vagrant Landrush process. Although I’m using cdk.vm as the domain name, the default value is vagrant.test, however in the next section I’ll show how to configure your virtual machine to use custom DNS names.

    If you are using the NetworkManager service, you must run the same command, changed slightly for use with NetworkManager:

    sudo sh -c 'echo "server=/cdk.vm/127.0.0.1#10053" > /etc/NetworkManager/vagrant-landrush'

    And you must set the dns auto-configuration to use dnsmasq. To do so, edit /etc/NetworkManager/NetworkManager.conf and set the following values:

    [main]
    plugins=ifcfg-rh,ibft
    dns=dnsmasq

    Configuring your OpenShift CDK machine

    Now you need to add the Vagrant Landrush configuration in the Vagrantfile of your OpenShift CDK Machine. Add the following content to enable Vagrant Landrush:

    config.vm.hostname = "openshift.cdk.vm"
    config.landrush.enabled = true
    config.landrush.host_ip_address = "#{PUBLIC_ADDRESS}"
    config.landrush.tld = "openshift.cdk.vm"
    config.landrush.guest_redirect_dns = false

    This snippet will:

    • Set the hostname to openshift.cdk.vm
    • Enable Vagrant Landrush on the machine
    • Set the IP Address to the same IP assigned to OpenShift CDK Machine (generally the IP address is 10.1.2.2)
    • Set a TLD name to openshift.cdk.vm (that way all DNS names with openshift.cdk.vm suffix will resolve to the same IP address)
    • Proxy all DNS requests

    After this configuration, all you need to do is bring up your OpenShift Virtual Machine with the command vagrant up and you’ll be able to access your OpenShift Machine using the URL https://openshift.cdk.vm:8443.

    What about my OpenShift applications?

    One of the good things about Vagrant Landrush is that it can accept wildcard domains, meaning that anything under the specified TLD can resolve to the Virtual Machine address.

    In this case, everything under openshift.cdk.vm can be resolved to 10.1.2.2 address (which is exactly what we need to resolve DNS names for our applications). However, in the provisioning phase, Vagrant sets OpenShift to use cdk.vm as the routing subdomain, which will create all routes under .cdk.vm and you will need to fix them manually.

    One thing to solve this issue is add some lines in the provision snippet of the Vagrantfile to reconfigure OpenShift to resolve to the correct subdomain:

    config.vm.provision "shell", inline: <<-SHELL
      sudo systemctl enable openshift
      sudo systemctl start openshift</pre>
      sudo sed -i 's/subdomain: <a href="http://openshift.cdk.vm.10.1.2.2.xip.io/subdomain" target="_blank">openshift.cdk.vm.10.1.2.2.xip.<wbr />io/subdomain</a>: openshift.cdk.vm/' /var/lib/openshift/openshift.<wbr />local.config/master/master-<wbr />config.yaml
      sudo systemctl restart openshift SHELL

    With this configuration, all your applications will automatically create a route with a DNS name inside openshift.cdk.vm. Now, enjoy access your applications using a special DNS name!

    Last updated: January 19, 2023

    Recent Posts

    • MCP servers vs. skills: Choosing the right context for your AI

    • How to route external and local LLMs with Models-as-a-Service

    • Protect data offloaded to GPU-accelerated environments with OpenShift sandboxed containers

    • Case study: Measuring energy efficiency on the x64 platform

    • How to prevent AI inference stack silent failures

    What’s up next?

     

    Red Hat Developers logo LinkedIn YouTube Twitter Facebook

    Platforms

    • Red Hat AI
    • Red Hat Enterprise Linux
    • Red Hat OpenShift
    • Red Hat Ansible Automation Platform
    • See all products

    Build

    • Developer Sandbox
    • Developer tools
    • Interactive tutorials
    • API catalog

    Quicklinks

    • Learning resources
    • E-books
    • Cheat sheets
    • Blog
    • Events
    • Newsletter

    Communicate

    • About us
    • Contact sales
    • Find a partner
    • Report a website issue
    • Site status dashboard
    • Report a security problem

    RED HAT DEVELOPER

    Build here. Go anywhere.

    We serve the builders. The problem solvers who create careers with code.

    Join us if you’re a developer, software engineer, web designer, front-end designer, UX designer, computer scientist, architect, tester, product manager, project manager or team lead.

    Sign me up

    Red Hat legal and privacy links

    • About Red Hat
    • Jobs
    • Events
    • Locations
    • Contact Red Hat
    • Red Hat Blog
    • Inclusion at Red Hat
    • Cool Stuff Store
    • Red Hat Summit
    © 2026 Red Hat

    Red Hat legal and privacy links

    • Privacy statement
    • Terms of use
    • All policies and guidelines
    • Digital accessibility

    Chat Support

    Please log in with your Red Hat account to access chat support.